Minor heapmem test fixes.
@@ -81,6 +81,7 @@ UNIT_TEST(do_many_allocations)
unsigned misalignments = 0;
unsigned min_alignment = heapmem_alignment();
+ /* The minimum alignment value must be a power of two */
UNIT_TEST_ASSERT(min_alignment != 0);
UNIT_TEST_ASSERT(!(min_alignment & (min_alignment - 1)));
@@ -146,6 +147,8 @@ UNIT_TEST(invalid_freeing)
UNIT_TEST_ASSERT(heapmem_free(NULL) == false);
char *ptr = heapmem_alloc(10);
+ /* This small allocation should succeed. */
+ UNIT_TEST_ASSERT(ptr != NULL);
/* A single free operation on allocated memory should succeed. */
UNIT_TEST_ASSERT(heapmem_free(ptr) == true);
@@ -191,7 +194,8 @@ UNIT_TEST(stats_check)
heapmem_stats_t stats;
heapmem_stats(&stats);
- printf("* allocated %zu\n* overhead %zu\n* available %zu\n* footprint %zu\n* chunks %zu\n",
+ printf("* allocated %zu\n* overhead %zu\n* available %zu\n"
+ "* footprint %zu\n* chunks %zu\n",
stats.allocated, stats.overhead, stats.available,
stats.footprint, stats.chunks);
