diff options
author | Damien George <damien.p.george@gmail.com> | 2016-10-14 00:32:34 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-10-14 00:32:34 +1100 |
commit | 34d0b3f85c9926d854acd7723b9e057744916ee0 (patch) | |
tree | 8ed2b83c3bbc735799db21ac1bd4bdf8bb090a9a /tests/micropython/heapalloc.py | |
parent | 6a4c6fc023292b42502b67b4ec3ece62d188ac14 (diff) |
tests/micropython: Add tests for heap_lock, and emergency exceptions.
Diffstat (limited to 'tests/micropython/heapalloc.py')
-rw-r--r-- | tests/micropython/heapalloc.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/micropython/heapalloc.py b/tests/micropython/heapalloc.py index 2dc7fa5e7..a651158ca 100644 --- a/tests/micropython/heapalloc.py +++ b/tests/micropython/heapalloc.py @@ -1,6 +1,6 @@ # check that we can do certain things without allocating heap memory -import gc +import micropython def f1(a): print(a) @@ -28,12 +28,7 @@ def test(): f2(i, i) # 2 args f3(1, 2, 3, 4) # function with lots of local state -# call h with heap allocation disabled and all memory used up -gc.disable() -try: - while True: - 'a'.lower # allocates 1 cell for boundmeth -except MemoryError: - pass +# call test() with heap allocation disabled +micropython.heap_lock() test() -gc.enable() +micropython.heap_unlock() |