From 755a7f962e2323a6421d40cb435bf6cea2046d04 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Mon, 7 Feb 2022 11:40:05 +0200 Subject: test(watchdog): more robust tests add assertions, fix #115 --- src/peripherals/watchdog.spec.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/peripherals') 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; -- cgit v1.2.3