diff -r fd948e5af26e -r 2cbdb482d325 tests/test_buffer.c --- a/tests/test_buffer.c Thu Dec 04 18:57:54 2025 +0100 +++ b/tests/test_buffer.c Fri Dec 05 16:11:39 2025 +0100 @@ -32,35 +32,6 @@ #include "cx/buffer.h" -#ifdef _WIN32 -#include -#include -static unsigned long system_page_size(void) { - static unsigned long ps = 0; - if (ps == 0) { - SYSTEM_INFO sysinfo; - GetSystemInfo(&sysinfo); - ps = sysinfo.dwPageSize; - } - return ps; -} -#else -#include -static unsigned long system_page_size(void) { - static unsigned long ps = 0; - if (ps == 0) { - long sc = sysconf(_SC_PAGESIZE); - if (sc < 0) { - // fallback for systems which do not report a value here - ps = 4096; // LCOV_EXCL_LINE - } else { - ps = (unsigned long) sc; - } - } - return ps; -} -#endif - CX_TEST(test_buffer_init_wrap_space) { CxTestingAllocator talloc; cx_testing_allocator_init(&talloc); @@ -234,8 +205,8 @@ CX_TEST_ASSERT(buf.capacity == 256); // greater than page size, new capacity should be multiple of pagesize - cxBufferMinimumCapacity(&buf, system_page_size() + 200); - CX_TEST_ASSERT(buf.capacity == system_page_size()*2); + cxBufferMinimumCapacity(&buf, cx_system_page_size() + 200); + CX_TEST_ASSERT(buf.capacity == cx_system_page_size()*2); cxBufferDestroy(&buf); CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));