diff --git a/tests/micropython/viper_ptr16_store_boundary_intbig.py b/tests/micropython/viper_ptr16_store_boundary_intbig.py index 1694c61ac0..2193eddae1 100644 --- a/tests/micropython/viper_ptr16_store_boundary_intbig.py +++ b/tests/micropython/viper_ptr16_store_boundary_intbig.py @@ -3,7 +3,9 @@ SET_TEMPLATE = """ @micropython.viper def set{off}(dest: ptr16): + saved = dest dest[{off}] = {val} + assert int(saved) == int(dest) set{off}(buffer) print(hex(get_index(buffer, {off}))) """ @@ -15,7 +17,9 @@ MASK = (1 << (8 * SIZE)) - 1 @micropython.viper def set_index(dest: ptr16, i: int, val: uint): + saved = dest dest[i] = val + assert int(saved) == int(dest) def get_index(src, i): diff --git a/tests/micropython/viper_ptr32_store_boundary_intbig.py b/tests/micropython/viper_ptr32_store_boundary_intbig.py index 5109abb9dc..b44f31b00a 100644 --- a/tests/micropython/viper_ptr32_store_boundary_intbig.py +++ b/tests/micropython/viper_ptr32_store_boundary_intbig.py @@ -3,7 +3,9 @@ SET_TEMPLATE = """ @micropython.viper def set{off}(dest: ptr32): + saved = dest dest[{off}] = {val} + assert int(saved) == int(dest) set{off}(buffer) print(hex(get_index(buffer, {off}))) """ @@ -15,7 +17,9 @@ MASK = (1 << (8 * SIZE)) - 1 @micropython.viper def set_index(dest: ptr32, i: int, val: uint): + saved = dest dest[i] = val + assert int(saved) == int(dest) def get_index(src, i): diff --git a/tests/micropython/viper_ptr8_store_boundary_intbig.py b/tests/micropython/viper_ptr8_store_boundary_intbig.py index e1fe6dcae3..d22a062743 100644 --- a/tests/micropython/viper_ptr8_store_boundary_intbig.py +++ b/tests/micropython/viper_ptr8_store_boundary_intbig.py @@ -3,7 +3,9 @@ SET_TEMPLATE = """ @micropython.viper def set{off}(dest: ptr8): + saved = dest dest[{off}] = {val} + assert int(saved) == int(dest) set{off}(buffer) print(hex(get_index(buffer, {off}))) """ @@ -15,7 +17,9 @@ MASK = (1 << (8 * SIZE)) - 1 @micropython.viper def set_index(dest: ptr8, i: int, val: uint): + saved = dest dest[i] = val + assert int(dest) == int(saved) def get_index(src: ptr8, i: int):