Exemple #1
0
def test_get_index_default_values():
    memmgr = AsmMemoryManager()
    jumps = [64, 86, 115, 154, 206, 275, 367, 490, 654, 873, 1165,
             1554, 2073, 2765, 3687, 4917, 6557, 8743, 11658, 15545,
             20727, 27637, 36850, 49134, 65513, 87351, 116469, 155293,
             207058, 276078, 368105]
    for i, jump in enumerate(jumps):
        assert memmgr._get_index(jump) == i
        assert memmgr._get_index(jump + 1) == i + 1
Exemple #2
0
def test_get_index_default_values():
    memmgr = AsmMemoryManager()
    jumps = [
        64, 86, 115, 154, 206, 275, 367, 490, 654, 873, 1165, 1554, 2073, 2765,
        3687, 4917, 6557, 8743, 11658, 15545, 20727, 27637, 36850, 49134,
        65513, 87351, 116469, 155293, 207058, 276078, 368105
    ]
    for i, jump in enumerate(jumps):
        assert memmgr._get_index(jump) == i
        assert memmgr._get_index(jump + 1) == i + 1
Exemple #3
0
def test_get_index():
    memmgr = AsmMemoryManager(min_fragment=8, num_indices=5)
    index = 0
    for length in range(100):
        assert memmgr._get_index(length) == index
        if length in [8, 11, 15, 21]:
            index += 1
Exemple #4
0
def test_get_index():
    memmgr = AsmMemoryManager(min_fragment=8,
                              num_indices=5)
    index = 0
    for length in range(100):
        assert memmgr._get_index(length) == index
        if length in [8, 11, 15, 21]:
            index += 1