diff options
| author | Uri Shaked | 2022-02-07 11:40:05 +0200 |
|---|---|---|
| committer | Uri Shaked | 2022-02-07 11:40:19 +0200 |
| commit | 755a7f962e2323a6421d40cb435bf6cea2046d04 (patch) | |
| tree | 15a63bbe97aab9d8b1d27f7dd3f1d94437383bcc /src/peripherals/watchdog.spec.ts | |
| parent | 0.18.8 (diff) | |
| download | avr8js-755a7f962e2323a6421d40cb435bf6cea2046d04.tar.gz avr8js-755a7f962e2323a6421d40cb435bf6cea2046d04.tar.bz2 avr8js-755a7f962e2323a6421d40cb435bf6cea2046d04.zip | |
test(watchdog): more robust tests
add assertions, fix #115
Diffstat (limited to '')
| -rw-r--r-- | src/peripherals/watchdog.spec.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/peripherals/watchdog.spec.ts b/src/peripherals/watchdog.spec.ts index 6fea3b3..edd7631 100644 --- a/src/peripherals/watchdog.spec.ts +++ b/src/peripherals/watchdog.spec.ts @@ -118,10 +118,12 @@ describe('Watchdog', () => { // Now we skip 8ms. Watchdog shouldn't fire, yet cpu.cycles += 16000 * 8; runner.runInstructions(1); + expect(cpu.pc).not.toEqual(0); // Now we skip an extra 8ms. We extended the timeout with WDR, so watchdog won't fire yet cpu.cycles += 16000 * 8; runner.runInstructions(1); + expect(cpu.pc).not.toEqual(0); // Finally, another 8ms bring us to 16ms since last WDR, and watchdog should fire cpu.cycles += 16000 * 8; |
