Unit tests: Use == to compare strings (#741)

When there's a mismatch, Catch2 will output the contents of both
strings rather than a meaningless .compare() numeric value.
This commit is contained in:
Frank Dana
2021-09-27 07:14:48 -04:00
committed by GitHub
parent b8b55050dc
commit 88d3011455
4 changed files with 5 additions and 8 deletions

View File

@@ -536,7 +536,7 @@ R"( 1 10.0000
999 12345.6777)";
// Ensure the two strings are equal up to the limits of 'expected'
CHECK(output.str().compare(0, expected.size(), expected) == 0);
CHECK(output.str().substr(0, expected.size()) == expected);
}
TEST_CASE( "PrintValues", "[libopenshot][keyframe]" )
@@ -582,7 +582,7 @@ R"(│Frame# (X) │ Y Value │ Delta Y │ Increasing? │ Repeat Fraction
25 16.5446 +1 true Fraction(1, 2) )";
// Ensure the two strings are equal up to the limits of 'expected'
CHECK(output.str().compare(0, expected.size(), expected) == 0);
CHECK(output.str().substr(0, expected.size()) == expected);
}
#ifdef USE_OPENCV