tests/basics/gc1: Garbage collector threshold() coverage.

pull/2570/head
Alex March 2016-10-27 11:31:24 +01:00 zatwierdzone przez Paul Sokolovsky
rodzic 8a49905a2f
commit 964fb2450e
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -20,3 +20,11 @@ if hasattr(gc, 'mem_free'):
# just test they execute and return an int
assert type(gc.mem_free()) is int
assert type(gc.mem_alloc()) is int
if hasattr(gc, 'threshold'):
# uPy has this extra function
# check execution and returns
assert(gc.threshold(1) is None)
assert(gc.threshold() == 0)
assert(gc.threshold(-1) is None)
assert(gc.threshold() == -1)