|
|
@@ -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); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|