From c04cd21ef5d0476642394f21fd0415b3875bd270 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Wed, 21 Feb 2024 23:27:20 -0300 Subject: [PATCH] fix tests with clang --- test/test_binn.c | 8 ++++++-- test/test_binn2.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test_binn.c b/test/test_binn.c index 3d980c7..4bfdcce 100644 --- a/test/test_binn.c +++ b/test/test_binn.c @@ -20,6 +20,10 @@ extern void* (*malloc_fn)(int len); extern void* (*realloc_fn)(void *ptr, int len); extern void (*free_fn)(void *ptr); +BINN_PRIVATE int CalcAllocation(int needed_size, int alloc_size); +BINN_PRIVATE BOOL IsValidBinnHeader(const void *pbuf, int *ptype, int *pcount, int *psize, int *pheadersize); +void test_binn2(); + /*************************************************************************************/ void test_binn_version() { @@ -1758,7 +1762,7 @@ void test3() { //assert(binn_ptr(&size) == NULL); //assert(binn_ptr(&count) == NULL); - assert(IsValidBinnHeader(NULL) == FALSE); + assert(IsValidBinnHeader(NULL,NULL,NULL,NULL,NULL) == FALSE); ptr = binn_ptr(obj); assert(ptr != NULL); @@ -1901,7 +1905,7 @@ int main() { puts("\nStarting the unit/regression tests...\n"); - printf("sizeof(binn) = %d\n\n", sizeof(binn)); + printf("sizeof(binn) = %ld\n\n", sizeof(binn)); test_binn_version(); diff --git a/test/test_binn2.c b/test/test_binn2.c index ffd8ea9..0dd8422 100644 --- a/test/test_binn2.c +++ b/test/test_binn2.c @@ -292,8 +292,8 @@ char * test_create_object_2(int *psize) { assert(binn_object_set_int64(obj, "int64", -1234567890123) == TRUE); assert(binn_object_set_uint32(obj, "uint32", 123456) == TRUE); - assert(binn_object_set_int16(obj, "uint16", 60500) == TRUE); - assert(binn_object_set_int8(obj, "uint8", 250) == TRUE); + assert(binn_object_set_uint16(obj, "uint16", 60500) == TRUE); + assert(binn_object_set_uint8(obj, "uint8", 250) == TRUE); assert(binn_object_set_uint64(obj, "uint64", 1234567890123) == TRUE); assert(binn_object_set_float(obj, "float32", -12.345) == TRUE);