aboutsummaryrefslogtreecommitdiff
path: root/MicSim/test/test_caretaker.py
diff options
context:
space:
mode:
Diffstat (limited to 'MicSim/test/test_caretaker.py')
-rw-r--r--MicSim/test/test_caretaker.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/MicSim/test/test_caretaker.py b/MicSim/test/test_caretaker.py
index 414bf37..cc8d2ef 100644
--- a/MicSim/test/test_caretaker.py
+++ b/MicSim/test/test_caretaker.py
@@ -30,6 +30,16 @@ class CaretakerTest(unittest.TestCase):
with self.assertRaises(KeyError): # Check it returns a KeyError
self.c["kjhkjhkoih"+str(randint(0,7698))]
+ # Check outside bound values
+ with self.assertRaises(Exception):
+ self.c["MBR"]=-128
+ with self.assertRaises(Exception):
+ self.c["MBR"]=256
+ with self.assertRaises(Exception):
+ self.c["PC"]=2**32
+ with self.assertRaises(Exception):
+ self.c["PC"]=-(2**31)
+
def test___setitem__(self):
"""
Test if getitem operation follow Mic-1 rules