// vim: ft=c #include #include "pmm.c" struct { uint8_t data[PAGE_SIZE]; }__attribute__((packed)) mem[4]; TEST(alloc_returns_freed_page) { pmm_free(&mem[0]); void *a = pmm_alloc(); ASSERT_EQ_PTR(a, &mem[0]); } TEST(alloc_returns_0_if_no_free_pages) { void *a = pmm_alloc(); ASSERT_EQ_PTR(a, 0); }