Skip to content

Commit

Permalink
Remove Warnings Modernize Use of auto (#96)
Browse files Browse the repository at this point in the history
* Modernize use of auto in TestPowerGrid.cpp
  * Why:
    * use auto when initializing with a cast to avoid duplicating the type name
* Modernize use of auto in TestGraph.cpp
  * Why:
    * use auto when initializing with a cast to avoid duplicating the type name
  • Loading branch information
franziska-wegner committed Jan 5, 2024
1 parent c83e2cd commit 7688fc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/DataStructures/Graphs/TestGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ TYPED_TEST( TestGraphFourVertices, AddEdge) {
}

// Add edge (0,1)
TEdgeProperties edgeProperties01 = TEdgeProperties(0);
auto edgeProperties01 = TEdgeProperties(0);
Types::edgeId source = 0;
Types::edgeId target = 1;
Types::edgeId id01 = this->graph_.AddEdge(source, target, edgeProperties01);
Expand All @@ -1635,7 +1635,7 @@ TYPED_TEST( TestGraphFourVertices, AddEdge) {


// Add edge (1,2)
TEdgeProperties edgeProperties12 = TEdgeProperties(1);
auto edgeProperties12 = TEdgeProperties(1);
source = 1;
target = 2;
Types::edgeId id12 = this->graph_.AddEdge(source, target, edgeProperties12);
Expand All @@ -1659,7 +1659,7 @@ TYPED_TEST( TestGraphFourVertices, AddEdge) {


// Add edge (0,3)
TEdgeProperties edgeProperties03 = TEdgeProperties(2);
auto edgeProperties03 = TEdgeProperties(2);
source = 0;
target = 3;
Types::edgeId id03 = this->graph_.AddEdge(source, target, edgeProperties03);
Expand Down
8 changes: 4 additions & 4 deletions tests/DataStructures/Graphs/TestPowerGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3223,7 +3223,7 @@ TEST_F ( TestPowerGridAcm2018MtsfFigure4a
TEST_F ( TestPowerGridAcm2018MtsfFigure4a
, AddLoadAtUsingVertexId )
{
Types::vertexId vertexId = static_cast<Types::vertexId>(2);
auto vertexId = static_cast<Types::vertexId>(2);
EXPECT_EQ ( 1, network_.NumberOfLoads() );
EXPECT_FALSE ( network_.HasLoadAt ( vertexId ) );
// Add load at vertex 2
Expand All @@ -3241,7 +3241,7 @@ TEST_F ( TestPowerGridAcm2018MtsfFigure4a
TEST_F ( TestPowerGridAcm2018MtsfFigure4b
, AddLoadAtUsingVertexId )
{
Types::vertexId vertexId = static_cast<Types::vertexId>(1);
auto vertexId = static_cast<Types::vertexId>(1);
EXPECT_EQ ( 1, network_.NumberOfLoads() );
EXPECT_FALSE ( network_.HasLoadAt ( vertexId ) );
// Add load at vertex 2
Expand Down Expand Up @@ -4774,7 +4774,7 @@ TEST_F ( TestNetworkEmpty
<< assertionString;
}

Types::generatorId generatorId = static_cast<Types::generatorId>(0);
auto generatorId = static_cast<Types::generatorId>(0);
assertionString = buildAssertionString ( "PowerGrid.hpp"
, "PowerGrid"
, "AddGeneratorRealPowerSnapshotAt"
Expand Down Expand Up @@ -4966,7 +4966,7 @@ TEST_F ( TestNetworkEmpty
<< assertionString;
}

Types::loadId loadId = static_cast<Types::loadId>(0);
auto loadId = static_cast<Types::loadId>(0);
assertionString = buildAssertionString ( "PowerGrid.hpp"
, "PowerGrid"
, "AddLoadSnapshotAt"
Expand Down

0 comments on commit 7688fc3

Please sign in to comment.