From 816f69416be1bccd3bebfe61f631b654ea292723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 28 May 2021 23:07:50 +0200 Subject: [PATCH] Use TestCaseInfo in tests directly --- tests/SelfTest/Baselines/compact.sw.approved.txt | 4 ++-- tests/SelfTest/Baselines/console.sw.approved.txt | 4 ++-- tests/SelfTest/Baselines/tap.sw.approved.txt | 4 ++-- tests/SelfTest/Baselines/xml.sw.approved.txt | 4 ++-- tests/SelfTest/IntrospectiveTests/Tag.tests.cpp | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index f3651ac2..4fd35284 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -2263,8 +2263,8 @@ Generators.tests.cpp:: passed: strlen(std::get<0>(data)) == static_ Generators.tests.cpp:: passed: strlen(std::get<0>(data)) == static_cast(std::get<1>(data)) for: 6 == 6 Generators.tests.cpp:: passed: strlen(std::get<0>(data)) == static_cast(std::get<1>(data)) for: 5 == 5 Generators.tests.cpp:: passed: strlen(std::get<0>(data)) == static_cast(std::get<1>(data)) for: 6 == 6 -Tag.tests.cpp:: passed: testcase->tags.size() == 1 for: 1 == 1 -Tag.tests.cpp:: passed: testcase->tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag +Tag.tests.cpp:: passed: testcase.tags.size() == 1 for: 1 == 1 +Tag.tests.cpp:: passed: testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag Exception.tests.cpp:: failed: unexpected exception with message: 'Why would you throw a std::string?' Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" Misc.tests.cpp:: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 7ecdf827..080ed71f 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -16123,12 +16123,12 @@ Tag.tests.cpp: ............................................................................... Tag.tests.cpp:: PASSED: - REQUIRE( testcase->tags.size() == 1 ) + REQUIRE( testcase.tags.size() == 1 ) with expansion: 1 == 1 Tag.tests.cpp:: PASSED: - REQUIRE( testcase->tags[0].original == "magic.tag"_catch_sr ) + REQUIRE( testcase.tags[0].original == "magic.tag"_catch_sr ) with expansion: magic.tag == magic.tag diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 311bf419..51f8fbca 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -4043,9 +4043,9 @@ ok {test-number} - strlen(std::get<0>(data)) == static_cast(std::get<1>( # tables ok {test-number} - strlen(std::get<0>(data)) == static_cast(std::get<1>(data)) for: 6 == 6 # tags with dots in later positions are not parsed as hidden -ok {test-number} - testcase->tags.size() == 1 for: 1 == 1 +ok {test-number} - testcase.tags.size() == 1 for: 1 == 1 # tags with dots in later positions are not parsed as hidden -ok {test-number} - testcase->tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag +ok {test-number} - testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag # thrown std::strings are translated not ok {test-number} - unexpected exception with message: 'Why would you throw a std::string?' # toString on const wchar_t const pointer returns the string contents diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 0931e8c3..290ab087 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -18997,7 +18997,7 @@ loose text artifact - testcase->tags.size() == 1 + testcase.tags.size() == 1 1 == 1 @@ -19005,7 +19005,7 @@ loose text artifact - testcase->tags[0].original == "magic.tag"_catch_sr + testcase.tags[0].original == "magic.tag"_catch_sr magic.tag == magic.tag diff --git a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp index 2fe9da23..a74b3159 100644 --- a/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -45,11 +45,11 @@ constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; TEST_CASE("shortened hide tags are split apart", "[tags]") { using Catch::StringRef; using Catch::Matchers::VectorContains; - auto testcase = Catch::makeTestCaseInfo("", {"fake test name", "[.magic-tag]"}, CATCH_INTERNAL_LINEINFO); + Catch::TestCaseInfo testcase("", {"fake test name", "[.magic-tag]"}, dummySourceLineInfo); // Extract parsed tags into strings std::vector tags; - for (auto const& tag : testcase->tags) { + for (auto const& tag : testcase.tags) { tags.push_back(tag.lowerCased); } REQUIRE_THAT(tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr)); @@ -58,10 +58,10 @@ TEST_CASE("shortened hide tags are split apart", "[tags]") { TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]") { using Catch::StringRef; using Catch::Matchers::VectorContains; - auto testcase = Catch::makeTestCaseInfo("", { "fake test name", "[magic.tag]" }, CATCH_INTERNAL_LINEINFO); + Catch::TestCaseInfo testcase("", { "fake test name", "[magic.tag]" }, dummySourceLineInfo); - REQUIRE(testcase->tags.size() == 1); - REQUIRE(testcase->tags[0].original == "magic.tag"_catch_sr); + REQUIRE(testcase.tags.size() == 1); + REQUIRE(testcase.tags[0].original == "magic.tag"_catch_sr); } TEST_CASE( "empty tags are not allowed", "[tags]" ) {