Skip to content

Commit

Permalink
Fixed test_network
Browse files Browse the repository at this point in the history
  • Loading branch information
MSallermann committed Mar 9, 2024
1 parent 31e1b48 commit ee51094
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TEST_CASE( "Testing the network class" )
REQUIRE_THAT( buffer_n_get, Catch::Matchers::UnorderedRangeEquals( buffer_n ) );
REQUIRE_THAT( buffer_w_get, Catch::Matchers::UnorderedRangeEquals( buffer_w ) );

// Now we test the transpose() function
// Now we test the toggle_incoming_outgoing() function

// First record all the old edges as tuples (i,j,w) where this edge goes from j -> i with weight w
std::set<std::tuple<size_t, size_t, Network::WeightT>> old_edges;
Expand All @@ -93,13 +93,13 @@ TEST_CASE( "Testing the network class" )
}

auto old_direction = network->direction();
network->transpose();
network->toggle_incoming_outgoing();
auto new_direction = network->direction();

// Direction should have changed as well
REQUIRE( old_direction != new_direction);
REQUIRE( old_direction != new_direction );

// Now we go over the transposed network and try to re-identify all edges
// Now we go over the toggled network and try to re-identify all edges
for( size_t i_agent = 0; i_agent < network->n_agents(); i_agent++ )
{
auto buffer_n = network->get_neighbours( i_agent );
Expand Down

0 comments on commit ee51094

Please sign in to comment.