]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/memory/memory-tests.factor
e1ba5c45d6ce96c9bdb42b9b24c66de50482ad0c
[factor.git] / basis / tools / memory / memory-tests.factor
1 USING: arrays assocs kernel math memory namespaces parser sequences
2 tools.memory tools.memory.private tools.test tools.time vm ;
3 IN: tools.memory.tests
4
5 { } [ room. ] unit-test
6 { } [ heap-stats. ] unit-test
7 { t } [ [ gc gc ] collect-gc-events array? ] unit-test
8 { } [ gc-events. ] unit-test
9 { } [ gc-stats. ] unit-test
10 { } [ gc-summary. ] unit-test
11 { } [ callback-room. ] unit-test
12
13 ! Each gc-event must reclaim something. #659
14 { f } [
15     [ "resource:basis/tools/memory/memory.factor" run-file ] time
16     gc-events get [ space-reclaimed 0 < ] any?
17 ] unit-test
18
19 { t t t } [
20     get-code-blocks code-block-stats nip
21     [ CODE-BLOCK-UNOPTIMIZED of 0 > ]
22     [ CODE-BLOCK-OPTIMIZED of 0 > ]
23     [ CODE-BLOCK-PIC of 0 > ] tri
24 ] unit-test