Skip to content

Commit

Permalink
fix tests with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Feb 22, 2024
1 parent ccec8f7 commit c04cd21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions test/test_binn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions test/test_binn2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c04cd21

Please sign in to comment.