from support import lib,ffi
from qcgc_test import QCGCTest

class AllocatorTest(QCGCTest):
    def test_cells_to_bytes(self):
        for i in range(1,17):
            self.assertEqual(1, lib.bytes_to_cells(i))
        self.assertEqual(2, lib.bytes_to_cells(17))

@@ -256,8 +256,361 @@
 ls(17))%0A
+%0A    def test_init_values(self):%0A        self.assertNotEqual(ffi.NULL, lib.arenas)%0A        for i in range(lib.qcgc_small_free_lists):%0A            l = lib.small_free_list(i)%0A            self.assertNotEqual(ffi.NULL, l)%0A        for i in range(lib.qcgc_large_free_lists):%0A            l = lib.large_free_list(i)%0A            self.assertNotEqual(ffi.NULL, l)%0A

Add testcase for allocator initialization