aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/std_bump_alloc/test_bump_alloc.py
blob: 717a122e087af662283f1e0ef33e6ac492801c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from test.utils import assemble_and_run_until_halted

def test_bump_reset():
  machine = assemble_and_run_until_halted(
    "test/e2e/std_bump_alloc/run_bump_reset.atk16"
  )

  heap_next_p = 0xE7EF
  heap_next = machine.mem_read(heap_next_p)
  assert heap_next == heap_next_p - 1

def test_bump_alloc():
  machine = assemble_and_run_until_halted(
    "test/e2e/std_bump_alloc/run_bump_alloc.atk16"
  )

  heap_next_p = 0xE7EF
  heap_next = machine.mem_read(heap_next_p)
  assert heap_next == heap_next_p - 1 - 5

  returned_value = machine.rg.value
  assert returned_value == heap_next + 1