summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wipy/wdt.py37
-rw-r--r--tests/wipy/wdt.py.exp7
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/wipy/wdt.py b/tests/wipy/wdt.py
new file mode 100644
index 000000000..9be6293b0
--- /dev/null
+++ b/tests/wipy/wdt.py
@@ -0,0 +1,37 @@
+'''
+WDT test for the CC3200 based boards
+'''
+
+from pyb import WDT
+
+# test the invalid cases first
+try:
+ wdt = WDT(1)
+except Exception:
+ print("Exception")
+
+try:
+ wdt = WDT(0, 500)
+except Exception:
+ print("Exception")
+
+try:
+ wdt = WDT(1, timeout=2000)
+except Exception:
+ print("Exception")
+
+wdt = WDT(timeout=1000)
+print(wdt)
+
+try:
+ wdt = WDT(0, timeout=2000)
+except Exception:
+ print("Exception")
+
+pyb.delay(500)
+wdt.feed()
+print(wdt)
+pyb.delay(900)
+wdt.feed()
+print(wdt)
+pyb.delay(950)
diff --git a/tests/wipy/wdt.py.exp b/tests/wipy/wdt.py.exp
new file mode 100644
index 000000000..71f5e13b5
--- /dev/null
+++ b/tests/wipy/wdt.py.exp
@@ -0,0 +1,7 @@
+Exception
+Exception
+Exception
+<WDT>
+Exception
+<WDT>
+<WDT>