Skip to content

Commit 76342be

Browse files
committed
fixed an issue with the NocStorage class unit test that caused a failure when running the Unit tests during a push
1 parent 3c31e04 commit 76342be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

vpr/test/test_noc_storage.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ TEST_CASE("test_add_link", "[vpr_noc]") {
118118
// testing datastructure
119119
NocStorage test_noc;
120120

121-
int total_num_of_links = NUM_OF_ROUTERS * NOC_CONNECTIVITY;
121+
// keeps track of the number of links created
122+
int total_num_of_links = 0;
122123

123124
// noc router stuff (we need routers before being able to add links)
124125
int router_id = 0;
@@ -150,6 +151,8 @@ TEST_CASE("test_add_link", "[vpr_noc]") {
150151

151152
// add the link to the NoC
152153
test_noc.add_link(source, sink);
154+
155+
total_num_of_links++;
153156
}
154157
}
155158
}
@@ -159,9 +162,9 @@ TEST_CASE("test_add_link", "[vpr_noc]") {
159162
link_id = (NocLinkId)link_number;
160163

161164
// verify the link by checking its properties
162-
REQUIRE(golden_set[link_number].get_source_router() == test_noc.get_noc_link_source_router(link_id));
165+
REQUIRE(test_noc.get_noc_router_id(golden_set[link_number].get_source_router()) == test_noc.get_noc_router_id(test_noc.get_noc_link_source_router(link_id)));
163166

164-
REQUIRE(golden_set[link_number].get_sink_router() == test_noc.get_noc_link_sink_router(link_id));
167+
REQUIRE(test_noc.get_noc_router_id(golden_set[link_number].get_sink_router()) == test_noc.get_noc_router_id(test_noc.get_noc_link_sink_router(link_id)));
165168
}
166169
}
167170
TEST_CASE("test_router_link_list", "[vpr_noc]") {

0 commit comments

Comments
 (0)