Browse Source

Added another couple tests to the memory test set.

master
Bryan Miller 5 years ago
parent
commit
5ba52a58d4
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      test/unit.src.memory.memory.spec.js

+ 18
- 1
test/unit.src.memory.memory.spec.js View File

@@ -328,10 +328,27 @@ describe("Testing Memory Module", function(){
mmc.connectMemory(new Mem.Memory.RAM(2));
mmc.connectMemory(new Mem.Memory.RAM(1));

it("Bytes match 4 pages.", function(){
it("Reports 4 pages", function(){
expect(mmc.pages).to.equal(4);
});

it("Bytes match 4 pages", function(){
expect(mmc.size).to.equal(1024);
});

it("Load / Read Check", function(){
mmc.load(0, [0x01, 0x02, 0x03, 0x04]);
mmc.load(0x0200, [0x11, 0x22, 0x33, 0x44]);
mmc.load(0x0300, [0xAA, 0xBB, 0xCC, 0xDD]);
mmc.load(0xFE, [0x41, 0x42, 0x43, 0x44]);

expect(mmc.read(0x01)).to.equal(0x02);
expect(mmc.read(0x0202)).to.equal(0x33);
expect(mmc.read(0x0303)).to.equal(0xDD);
expect(mmc.read(0xFF)).to.equal(0x42);
expect(mmc.read(0x0101)).to.equal(0x44);
});

});
});


Loading…
Cancel
Save