summaryrefslogtreecommitdiff
path: root/tests/if.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-01 00:49:52 -0400
committerbd <bdunahu@operationnull.com>2025-04-01 00:49:52 -0400
commit6579f7272905d1e25b43ef051da6c2180e60ca2b (patch)
treea4b217aa56126f7d05304ab93f6c36b66fd6b694 /tests/if.cc
parenta4e0e5ff6208205f6ebd980f9ed1eca91dcc4311 (diff)
Ensure all stages only do work if they are not 'OK'
Diffstat (limited to 'tests/if.cc')
-rw-r--r--tests/if.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/if.cc b/tests/if.cc
index 4ebc47d..d6c1bca 100644
--- a/tests/if.cc
+++ b/tests/if.cc
@@ -36,7 +36,7 @@ class IFFixture
int i;
for (i = 0; i < this->m_delay + 1; ++i) {
- r = this->ct->advance(OK);
+ r = this->ct->advance(WAIT);
// check response
CHECK(r == nullptr);
}
@@ -52,13 +52,13 @@ class IFFixture
int i;
for (i = 0; i < this->c_delay; ++i) {
- r = this->ct->advance(OK);
+ r = this->ct->advance(WAIT);
// check response
- CHECK(r == nullptr);
+ REQUIRE(r == nullptr);
}
- r = this->ct->advance(OK);
+ r = this->ct->advance(WAIT);
// check response
- CHECK(r != nullptr);
+ REQUIRE(r != nullptr);
return r;
}
@@ -103,8 +103,7 @@ TEST_CASE_METHOD(IFFixture, "fetch returns two instuctions", "[if_pipe]")
delete i;
}
-TEST_CASE_METHOD(IFFixture, "fetch waits with old instruction",
-"[if_pipe]")
+TEST_CASE_METHOD(IFFixture, "fetch waits with old instruction", "[if_pipe]")
{
InstrDTO *i;
int j, expected_cycles, fetch_cycles;
@@ -115,20 +114,21 @@ TEST_CASE_METHOD(IFFixture, "fetch waits with old instruction",
for (j = 0; j < this->m_delay + 1; ++j) {
i = this->ct->advance(STALLED);
// check response
- CHECK(i == nullptr);
+ REQUIRE(i == nullptr);
}
for (j = 0; j < this->c_delay; ++j) {
i = this->ct->advance(STALLED);
// check response
- CHECK(i == nullptr);
+ REQUIRE(i == nullptr);
}
for (j = 0; j < expected_cycles - fetch_cycles; ++j) {
i = this->ct->advance(STALLED);
// check response
- CHECK(i != nullptr);
+ REQUIRE(i != nullptr);
}
- i = this->ct->advance(OK);
+ i = this->ct->advance(WAIT);
+ REQUIRE(i != nullptr);
CHECK(i->get_time_of(FETCH) == expected_cycles);
REQUIRE(i->get_instr_bits() == this->p[0]);