You can look at MemoryTest/Main.jack to see what it tests.
First it tests that poke() and peek() work.
Then it does some Array.new() calls and writes and reads from the Arrays returned from alloc().
Finally, it does some dispose() calls that call deAlloc().
This is not a particularly thorough test.
In fact, this alloc()/deAlloc() will pass the test!
/** Finds an available RAM block of the given size and returns
* a reference to its base address. */
function int alloc(int size) {
return 2048;
}
/** De-allocates the given object (cast as an array) by making
* it available for future allocations. */
function void deAlloc(Array o) {
return;
}
I'll look at writing a new test.
--Mark