From f6dcf53a356c8a13a7cecc83c74ff0605b656879 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 1 Feb 2019 19:31:31 +0900 Subject: [PATCH] Add test for internal atostr function --- src/test/UDPC_UnitTest.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/test/UDPC_UnitTest.c b/src/test/UDPC_UnitTest.c index 83115ee..b891d17 100644 --- a/src/test/UDPC_UnitTest.c +++ b/src/test/UDPC_UnitTest.c @@ -2,10 +2,11 @@ #include #include +#include static UnitTestState UDPC_uts = {0, 0}; -int main() +void TEST_DEQUE() { int arr[32]; char *temp = NULL; @@ -216,6 +217,23 @@ int main() */ UDPC_Deque_destroy(deque); - UNITTEST_REPORT(DEQUE_TEST) + UNITTEST_REPORT(DEQUE) +} + +void TEST_ATOSTR() +{ + UDPC_Context *ctx = malloc(sizeof(UDPC_Context)); + ASSERT_EQ_MEM( + UDPC_INTERNAL_atostr(ctx, (0xAC << 24) | (0x1E << 16) | (0x1 << 8) | 0xFF), + "172.30.1.255", + 12); + free(ctx); + UNITTEST_REPORT(ATOSTR); +} + +int main() +{ + TEST_DEQUE(); + TEST_ATOSTR(); return 0; }