@@ -279,7 +279,7 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
279
279
std::mt19937 rand_num_gen (device ());
280
280
281
281
// random number generation to determine routers of the link to remove
282
- std::uniform_int_distribution<std::mt19937::result_type> src_router (0 , NUM_OF_ROUTERS);
282
+ std::uniform_int_distribution<std::mt19937::result_type> src_router (0 , NUM_OF_ROUTERS- 1 );
283
283
std::uniform_int_distribution<std::mt19937::result_type> sink_router (1 , NOC_CONNECTIVITY - 1 );
284
284
285
285
// create the NoC
@@ -349,9 +349,9 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
349
349
350
350
auto & outgoing_links = test_noc.get_noc_router_connections (link_to_remove_src_router);
351
351
// go through all the outgoing links of the source router in the link we removed and check that the link does not exist there as well.
352
- for (auto outgoing_link_id = outgoing_links. begin (); outgoing_link_id != outgoing_links. end (); outgoing_link_id++ ) {
352
+ for (auto outgoing_link : outgoing_links) {
353
353
// get the current outgoing link
354
- const NocLink& curr_outgoing_link = test_noc.get_single_noc_link (*outgoing_link_id );
354
+ const NocLink& curr_outgoing_link = test_noc.get_single_noc_link (outgoing_link );
355
355
356
356
if ((curr_outgoing_link.get_source_router () == link_to_remove_src_router) && (curr_outgoing_link.get_sink_router () == link_to_remove_sink_router)) {
357
357
link_removed_from_outgoing_vector = false ;
@@ -363,9 +363,9 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
363
363
const auto & links_in_noc = test_noc.get_noc_links ();
364
364
// go through the links and make sure that none of them have the source and sink router of the link
365
365
// that we removed. THe removed link should have the source and sink routers set to invalid values.
366
- for (auto single_link = links_in_noc. begin (); single_link != links_in_noc. end (); single_link++ ) {
366
+ for (auto single_link : links_in_noc) {
367
367
// check whether the source and sink router of the current link matches the routers in the link to remove
368
- if ((single_link-> get_source_router () == link_to_remove_src_router) && (single_link-> get_sink_router () == link_to_remove_sink_router)) {
368
+ if ((single_link. get_source_router () == link_to_remove_src_router) && (single_link. get_sink_router () == link_to_remove_sink_router)) {
369
369
// this indicates that the link was not set to an invalid state and not removed properly
370
370
link_removed_from_outgoing_vector = false ;
371
371
break ;
0 commit comments