Skip to content

Commit 9fa1a3b

Browse files
this time
1 parent 5eb028f commit 9fa1a3b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

code/logic/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* -----------------------------------------------------------------------------
1313
*/
1414
#include "fossil/sys/memory.h"
15-
#include <stdlib.h>
15+
#include <stdlib.h> // Needed for posix_memalign
1616
#include <string.h>
1717
#include <stdio.h>
1818

code/tests/cases/test_memory.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ FOSSIL_TEST(c_test_memory_stats) {
240240
size_t allocs = 0, bytes = 0;
241241
fossil_sys_memory_stats(&allocs, &bytes);
242242
// Just check that the function runs and returns something
243-
ASSUME_ITS_TRUE(allocs >= (size_t)0);
244-
ASSUME_ITS_TRUE(bytes >= (size_t)0);
243+
ASSUME_ITS_TRUE(allocs != 0 || bytes != 0);
245244
}
246245

247246
// * * * * * * * * * * * * * * * * * * * * * * * *

code/tests/cases/test_memory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ FOSSIL_TEST(cpp_test_memory_class_stats) {
410410
size_t allocs = 0, bytes = 0;
411411
fossil::sys::Memory::stats(&allocs, &bytes);
412412
// Just check that stats call does not crash and returns something
413-
ASSUME_ITS_TRUE(allocs >= (size_t)0);
414-
ASSUME_ITS_TRUE(bytes >= (size_t)0);
413+
ASSUME_ITS_TRUE(&allocs != nullptr);
414+
ASSUME_ITS_TRUE(&bytes != nullptr);
415415
}
416416

417417
// * * * * * * * * * * * * * * * * * * * * * * * *

0 commit comments

Comments
 (0)