aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals
diff options
context:
space:
mode:
authorUri Shaked2022-02-07 11:40:05 +0200
committerUri Shaked2022-02-07 11:40:19 +0200
commit755a7f962e2323a6421d40cb435bf6cea2046d04 (patch)
tree15a63bbe97aab9d8b1d27f7dd3f1d94437383bcc /src/peripherals
parent0.18.8 (diff)
downloadavr8js-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.ts2
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;
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.