From 386d4d6c1ae1c8e620b39e98c34228663912cb9a Mon Sep 17 00:00:00 2001
From: Johannes Kung <johku144@student.liu.se>
Date: Tue, 2 Jul 2024 16:06:58 +0200
Subject: [PATCH] Fixed broken tests due to renambed processor attributes

---
 test/test_core/test_breakpoint.py | 28 ++++++++++++++--------------
 test/test_core/test_reset.py      | 24 ++++++++++++------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/test/test_core/test_breakpoint.py b/test/test_core/test_breakpoint.py
index ec961f4..e2e600c 100644
--- a/test/test_core/test_breakpoint.py
+++ b/test/test_core/test_breakpoint.py
@@ -201,14 +201,14 @@ def test_add_remove_memory_breakpoint():
     mem = Memory(in_s, out_s, ctrl_s, adr_s, 8)
     cpu.add_module(mem)
 
-    assert len(cpu.breakpoints) == 0
-    assert cpu.breakpoint_id_counter == 1
+    assert len(cpu._breakpoints) == 0
+    assert cpu._breakpoint_id_counter == 1
     cpu.add_memory_breakpoint("Memory", 1, 1)
-    assert cpu.breakpoint_id_counter == 2
-    assert len(cpu.breakpoints) == 1
+    assert cpu._breakpoint_id_counter == 2
+    assert len(cpu._breakpoints) == 1
     assert cpu.remove_breakpoint(1) == True
-    assert cpu.breakpoints == {}
-    assert len(cpu.breakpoints) == 0
+    assert cpu._breakpoints == {}
+    assert len(cpu._breakpoints) == 0
 
 
 def test_stop_on_memory_breakpoint():
@@ -223,7 +223,7 @@ def test_stop_on_memory_breakpoint():
     mem = Memory(in_s, out_s, ctrl_s, adr_s, 8)
     cpu.add_module(mem)
     assert mem._memory == [0 for _ in range(8)]
-    assert cpu.clock == 0
+    assert cpu._clock == 0
 
     in_s.update_value(1)
     ctrl_s.update_value(True)
@@ -235,7 +235,7 @@ def test_stop_on_memory_breakpoint():
     cpu.run_continuously()
     assert mem._memory == [0, 0, 1, 0, 0, 0, 0, 0]
     assert cpu.is_stopped == True
-    assert cpu.clock == 2
+    assert cpu._clock == 2
 
     mem._memory = [0 for _ in range(8)]
     in_s.update_value(1)
@@ -257,14 +257,14 @@ def test_add_remove_state_breakpoint():
     lc = LC(s, s, s, s)
     cpu.add_module(lc)
 
-    assert len(cpu.breakpoints) == 0
-    assert cpu.breakpoint_id_counter == 1
+    assert len(cpu._breakpoints) == 0
+    assert cpu._breakpoint_id_counter == 1
     cpu.add_state_breakpoint("LC", "value", 1)
-    assert len(cpu.breakpoints) == 1
-    assert cpu.breakpoint_id_counter == 2
+    assert len(cpu._breakpoints) == 1
+    assert cpu._breakpoint_id_counter == 2
     assert cpu.remove_breakpoint(1) == True
-    assert cpu.breakpoints == {}
-    assert len(cpu.breakpoints) == 0
+    assert cpu._breakpoints == {}
+    assert len(cpu._breakpoints) == 0
 
 
 def test_stop_on_state_breakpoint():
diff --git a/test/test_core/test_reset.py b/test/test_core/test_reset.py
index 6d84136..bec0a73 100644
--- a/test/test_core/test_reset.py
+++ b/test/test_core/test_reset.py
@@ -35,22 +35,22 @@ class DummyModule(Module):
 
 def test_reset():
     cpu = Processor()
-    cpu.signal_history = ["this", "should", "be", "removed"]
+    cpu._signal_history = ["this", "should", "be", "removed"]
     dummy = DummyModule()
-    cpu.clock = 100
-    cpu.removed_cycles = 1337
-    cpu.module_history.append(dummy.get_state())
-    cpu.signal_history.clear()
-    cpu.removed_cycles = 0
-    cpu.assembly_cycles = [i for i in range(9)]
+    cpu._clock = 100
+    cpu._removed_cycles = 1337
+    cpu._module_history.append(dummy.get_state())
+    cpu._signal_history.clear()
+    cpu._removed_cycles = 0
+    cpu._assembly_cycles = [i for i in range(9)]
     cpu.add_module(dummy)
     cpu.reset()
     assert dummy.name == "dummy"
     assert dummy.a == 0
     assert dummy.b == ""
     assert dummy.c == []
-    assert cpu.clock == 0
-    assert cpu.removed_cycles == 0
-    assert cpu.module_history == []
-    assert cpu.signal_history == []
-    assert cpu.assembly_cycles == [0]
+    assert cpu._clock == 0
+    assert cpu._removed_cycles == 0
+    assert cpu._module_history == []
+    assert cpu._signal_history == []
+    assert cpu._assembly_cycles == [0]
-- 
GitLab