Skip to content

Commit b2a6c5a

Browse files
committed
Add test for MEMAVAIL and MAXAVAIL
Test heap functions
1 parent 7c86925 commit b2a6c5a

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

tests/runtime/cases/maxavail.bas

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include "lib/tst_framework.bas"
2+
3+
INIT("Testing MEMAVAIL, MAXAVAIL")
4+
5+
#include <alloc.bas>
6+
DIM hasError as Ubyte = 0
7+
8+
SUB showResult()
9+
PRINT TAB 12;
10+
IF hasError THEN
11+
hasError = 0
12+
SHOW_ERROR
13+
ELSE
14+
SHOW_OK
15+
END IF
16+
PRINT
17+
END SUB
18+
19+
20+
PRINT maxavail(); " "; memavail();
21+
LET hasError = maxavail() <> 4764 or memavail() <> 4764
22+
showResult()
23+
24+
a$ = "HELLO WORLD"
25+
PRINT maxavail(); " "; memavail();
26+
LET hasError = maxavail() <> 4749 or memavail() <> 4749
27+
showResult()
28+
29+
a$ = a$ + a$
30+
PRINT maxavail(); " "; memavail();
31+
LET hasError = maxavail() <> 4723 or memavail() <> 4738
32+
showResult()
33+
34+
FINISH
6.75 KB
Binary file not shown.

tests/runtime/maxavail.bas

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)