Skip to content

Commit

Permalink
Remove Test Raw String Warnings from C/C++ Linter (#74)
Browse files Browse the repository at this point in the history
This PR removes some warnings by using raw strings that avoids escaping sequences.

*Commits:*
* Add raw strings to avoid escaping
* Add raw strings in dynamic graph test to avoid escaping
* Add raw strings in mapping binary heap tests to avoid escaping
* Add raw strings in bucket tests to avoid escaping
* Add raw strings in binary heap tests to avoid escaping
* Add raw strings in dominating theta path tests to avoid escaping
* Add raw strings in PyPSA parser tests to avoid escaping
  • Loading branch information
franziska-wegner committed Jan 2, 2024
1 parent c4e9bb7 commit 50a74c8
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 88 deletions.
4 changes: 2 additions & 2 deletions tests/Algorithms/PathFinding/TestDominatingThetaPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST_F ( TestDTPEmptyGraph
auto assertionString = buildAssertionString ( "DominatingThetaPath.hpp"
, "DominatingThetaPath"
, "Source"
, "source < labelSets_.size\\(\\)");
, R"(source < labelSets_.size\(\))");

ASSERT_DEATH ( {dtp_.Source(0);}, assertionString );
}
Expand All @@ -59,7 +59,7 @@ TEST_F ( TestDTPEmptyGraph
auto assertionString = buildAssertionString ( "DominatingThetaPath.hpp"
, "DominatingThetaPath"
, "Source"
, "source < labelSets_.size\\(\\)");
, R"(source < labelSets_.size\(\))");

try {
dtp_.Source(0);
Expand Down
28 changes: 14 additions & 14 deletions tests/DataStructures/Container/TestBinaryHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "Top"
, "!Empty\\(\\)");
, R"(!Empty\(\))");
ASSERT_DEATH( {heapConst_.Top();}, assertionString );
}
#else
Expand All @@ -71,7 +71,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "Top"
, "!Empty\\(\\)");
, R"(!Empty\(\))");
try {
heapConst_.Top();
} catch ( std::runtime_error const & error ) {
Expand Down Expand Up @@ -221,7 +221,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DecreaseKey"
, "index < Size\\(\\)" );
, R"(index < Size\(\))" );

TElement p = -1;

Expand All @@ -235,7 +235,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DecreaseKey"
, "index < Size\\(\\)" );
, R"(index < Size\(\))" );
TElement p = -1;

try {
Expand All @@ -257,7 +257,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "ChangeKey"
, "index < Size\\(\\)");
, R"(index < Size\(\))");

TElement p = -1;

Expand All @@ -271,7 +271,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "ChangeKey"
, "index < Size\\(\\)");
, R"(index < Size\(\))");
TElement p = -1;

try {
Expand Down Expand Up @@ -339,7 +339,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "Pop"
, "Size\\(\\) > 0");
, R"(Size\(\) > 0)");
ASSERT_DEATH( {heap_.Pop();}, assertionString );
}
#else
Expand All @@ -350,7 +350,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "Pop"
, "Size\\(\\) > 0");
, R"(Size\(\) > 0)");
try {
heap_.Pop();
} catch ( std::runtime_error const & error ) {
Expand All @@ -370,7 +370,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DeleteTop"
, "Size\\(\\) > 0");
, R"(Size\(\) > 0)");

ASSERT_DEATH( {heap_.DeleteTop();}, assertionString );
}
Expand All @@ -382,7 +382,7 @@ TEST_F( TestBinaryHeap,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DeleteTop"
, "Size\\(\\) > 0");
, R"(Size\(\) > 0)");
try {
heap_.DeleteTop();
} catch ( std::runtime_error const & error ) {
Expand Down Expand Up @@ -718,7 +718,7 @@ TEST_F (TestBinaryHeapWithOneIntegerElement,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DecreaseKey"
, "index < Size\\(\\)" );
, R"(index < Size\(\))" );

ASSERT_DEATH( {heap_.DecreaseKey(7, 123);}, assertionString );
}
Expand All @@ -730,7 +730,7 @@ TEST_F (TestBinaryHeapWithOneIntegerElement,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "DecreaseKey"
, "index < Size\\(\\)" );
, R"(index < Size\(\))" );
try {
heap_.DecreaseKey(7, 123);
} catch ( std::runtime_error const & error ) {
Expand Down Expand Up @@ -785,7 +785,7 @@ TEST_F (TestBinaryHeapWithOneIntegerElement,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "ChangeKey"
, "index < Size\\(\\)");
, R"(index < Size\(\))");

ASSERT_DEATH( {heap_.ChangeKey(7, 123);}, assertionString );
}
Expand All @@ -797,7 +797,7 @@ TEST_F (TestBinaryHeapWithOneIntegerElement,
auto assertionString = buildAssertionString ( "BinaryHeap.hpp"
, "BinaryHeap"
, "ChangeKey"
, "index < Size\\(\\)");
, R"(index < Size\(\))");
try {
heap_.ChangeKey(7, 123);
} catch ( std::runtime_error const & error ) {
Expand Down
Loading

0 comments on commit 50a74c8

Please sign in to comment.