Permalink
Browse files

Memory test

  • Loading branch information...
1 parent 484d1f4 commit b61ca7f0c64dc8e8d8333947314b009f0ddb3434 @paul999 committed Mar 6, 2012
Showing with 15 additions and 1 deletion.
  1. +15 −1 test.html
View
@@ -56,16 +56,30 @@
});
test("Save memory", function()
{
- expect(3)
+ expect(8)
setup()
window.pc.create()
+ equal(window.pc.getMemory(8)[(1024 * 1024 * 5 + 16) + 10], undefined, "Test memory over max size")
+
window.pc.savememory(window.start, window.start.length, 0x10000)
equal(window.pc.getMemory(8)[0], 0, "Test memory 0")
equal(window.pc.getMemory(8)[0x10000], window.start[0], "Test memory 0x00000")
equal(window.pc.getMemory(8)[0x10000 + 10], window.start[10], "Test memory 0x00000 + 10")
+ setup()
+ window.pc.create()
+
+ window.pc.savememory(window.start, window.start.length, (1024 * 1024 * 5 + 16) + 10)
+
+ equal(window.pc.getMemory(8)[0], 0, "Test memory 0")
+ equal(window.pc.getMemory(8)[0x10000], 0, "Test memory 0x00000")
+
+ equal(window.pc.getMemory(8)[0x10000 + 10], 0, "Test memory 0x00000 + 10")
+
+ equal(window.pc.getMemory(8)[(1024 * 1024 * 5 + 16) + 10], undefined, "Test memory over max size with data set")
+
});
});

0 comments on commit b61ca7f

Please sign in to comment.