aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/eeprom.spec.ts
diff options
context:
space:
mode:
authorUri Shaked2020-08-01 15:47:35 +0300
committerUri Shaked2020-08-01 15:47:35 +0300
commitb0bfe885f7f53d6ae0ff03977b4cd9f2b3eb856b (patch)
tree00c2dce9476c7c412b2d81445249d681ef368994 /src/peripherals/eeprom.spec.ts
parentchore(deps): npm audit fix (diff)
downloadavr8js-b0bfe885f7f53d6ae0ff03977b4cd9f2b3eb856b.tar.gz
avr8js-b0bfe885f7f53d6ae0ff03977b4cd9f2b3eb856b.tar.bz2
avr8js-b0bfe885f7f53d6ae0ff03977b4cd9f2b3eb856b.zip
test(timer): use TestProgramRunner
Diffstat (limited to '')
-rw-r--r--src/peripherals/eeprom.spec.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peripherals/eeprom.spec.ts b/src/peripherals/eeprom.spec.ts
index 75cd5ea..487ce41 100644
--- a/src/peripherals/eeprom.spec.ts
+++ b/src/peripherals/eeprom.spec.ts
@@ -63,7 +63,7 @@ describe('EEPROM', () => {
it('should not erase the memory when writing if EEPM1 is high', () => {
// We subtract 0x20 to translate from RAM address space to I/O register space
- const { program } = asmProgram(`
+ const { program, instructionCount } = asmProgram(`
; register addresses
_REPLACE TWSR, ${EECR - 0x20}
_REPLACE EEARL, ${EEARL - 0x20}
@@ -85,7 +85,7 @@ describe('EEPROM', () => {
eepromBackend.memory[9] = 0x0f; // high four bits are cleared
const runner = new TestProgramRunner(cpu, eeprom);
- runner.runInstructions(program.length);
+ runner.runInstructions(instructionCount);
// EEPROM was 0x0f, and our program wrote 0x55.
// Since write (without erase) only clears bits, we expect 0x05 now.
@@ -197,7 +197,7 @@ describe('EEPROM', () => {
describe('EEPROM erase', () => {
it('should only erase the memory when EEPM0 is high', () => {
// We subtract 0x20 to translate from RAM address space to I/O register space
- const { program } = asmProgram(`
+ const { program, instructionCount } = asmProgram(`
; register addresses
_REPLACE TWSR, ${EECR - 0x20}
_REPLACE EEARL, ${EEARL - 0x20}
@@ -219,7 +219,7 @@ describe('EEPROM', () => {
eepromBackend.memory[9] = 0x22;
const runner = new TestProgramRunner(cpu, eeprom);
- runner.runInstructions(program.length);
+ runner.runInstructions(instructionCount);
expect(eepromBackend.memory[9]).toEqual(0xff);
});