From 803062eb299ca2a5e5bd378a3c1e640aae746a2d Mon Sep 17 00:00:00 2001 From: wmbat Date: Wed, 6 Dec 2023 17:44:21 -0500 Subject: [PATCH] Fixing sign conversion warnings in MatchersRanges.tests --- .../Baselines/compact.sw.approved.txt | 2 +- .../Baselines/compact.sw.multi.approved.txt | 2 +- .../Baselines/console.sw.approved.txt | 2 +- .../Baselines/console.sw.multi.approved.txt | 18 ++++++++--------- tests/SelfTest/Baselines/tap.sw.approved.txt | 2 +- .../Baselines/tap.sw.multi.approved.txt | 2 +- tests/SelfTest/Baselines/xml.sw.approved.txt | 20 +++++++++---------- .../Baselines/xml.sw.multi.approved.txt | 20 +++++++++---------- .../UsageTests/MatchersRanges.tests.cpp | 4 ++-- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 2b974606..04e30e65 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -316,7 +316,7 @@ MatchersRanges.tests.cpp:: passed: c, !Contains(1) for: { 4, 5, 6 } MatchersRanges.tests.cpp:: passed: a, Contains(0, close_enough) for: { 1, 2, 3 } contains element 0 MatchersRanges.tests.cpp:: passed: b, Contains(0, close_enough) for: { 0, 1, 2 } contains element 0 MatchersRanges.tests.cpp:: passed: c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 -MatchersRanges.tests.cpp:: passed: a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +MatchersRanges.tests.cpp:: passed: a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 MatchersRanges.tests.cpp:: passed: in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 MatchersRanges.tests.cpp:: passed: in, !Contains(8) for: { 1, 2, 3, 4, 5 } not contains element 8 MatchersRanges.tests.cpp:: passed: in, Contains(MoveOnlyTestElement{ 2 }) for: { 1, 2, 3 } contains element 2 diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 913255e5..913a3b4e 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -314,7 +314,7 @@ MatchersRanges.tests.cpp:: passed: c, !Contains(1) for: { 4, 5, 6 } MatchersRanges.tests.cpp:: passed: a, Contains(0, close_enough) for: { 1, 2, 3 } contains element 0 MatchersRanges.tests.cpp:: passed: b, Contains(0, close_enough) for: { 0, 1, 2 } contains element 0 MatchersRanges.tests.cpp:: passed: c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 -MatchersRanges.tests.cpp:: passed: a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +MatchersRanges.tests.cpp:: passed: a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 MatchersRanges.tests.cpp:: passed: in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 MatchersRanges.tests.cpp:: passed: in, !Contains(8) for: { 1, 2, 3, 4, 5 } not contains element 8 MatchersRanges.tests.cpp:: passed: in, Contains(MoveOnlyTestElement{ 2 }) for: { 1, 2, 3 } contains element 2 diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 3dc91c8a..e2badc3c 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -2605,7 +2605,7 @@ MatchersRanges.tests.cpp: ............................................................................... MatchersRanges.tests.cpp:: PASSED: - REQUIRE_THAT( a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) ) + REQUIRE_THAT( a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) ) with expansion: { "abc", "abcd", "abcde" } contains element 4 diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 6e0a0b33..b97ced94 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -2603,7 +2603,7 @@ MatchersRanges.tests.cpp: ............................................................................... MatchersRanges.tests.cpp:: PASSED: - REQUIRE_THAT( a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) ) + REQUIRE_THAT( a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) ) with expansion: { "abc", "abcd", "abcde" } contains element 4 @@ -5368,7 +5368,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 4 > 2 @@ -5380,7 +5380,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 4 > 3 @@ -5428,7 +5428,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 8 > 1 @@ -5440,7 +5440,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 8 > 2 @@ -5452,7 +5452,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 8 > 3 @@ -5500,7 +5500,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 12 > 1 @@ -5512,7 +5512,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 12 > 2 @@ -5524,7 +5524,7 @@ Generators.tests.cpp: ............................................................................... Generators.tests.cpp:: PASSED: - REQUIRE( 4u * i > str.size() ) + REQUIRE( 4u * static_cast(i) > str.size() ) with expansion: 12 > 3 diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index d2354590..507201d6 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -629,7 +629,7 @@ ok {test-number} - b, Contains(0, close_enough) for: { 0, 1, 2 } contains elemen # Basic use of the Contains range matcher ok {test-number} - c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 # Basic use of the Contains range matcher -ok {test-number} - a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +ok {test-number} - a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 # Basic use of the Contains range matcher ok {test-number} - in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 # Basic use of the Contains range matcher diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index a1d86622..4deedadc 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -627,7 +627,7 @@ ok {test-number} - b, Contains(0, close_enough) for: { 0, 1, 2 } contains elemen # Basic use of the Contains range matcher ok {test-number} - c, !Contains(0, close_enough) for: { 4, 5, 6 } not contains element 0 # Basic use of the Contains range matcher -ok {test-number} - a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 +ok {test-number} - a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) for: { "abc", "abcd", "abcde" } contains element 4 # Basic use of the Contains range matcher ok {test-number} - in, Contains(1) for: { 1, 2, 3, 4, 5 } contains element 1 # Basic use of the Contains range matcher diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index dcd9c3d1..a443a6b9 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -2750,7 +2750,7 @@ Nor would this
- a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) + a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) { "abc", "abcd", "abcde" } contains element 4 @@ -6086,7 +6086,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 1 @@ -6097,7 +6097,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 2 @@ -6108,7 +6108,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 3 @@ -6152,7 +6152,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 1 @@ -6163,7 +6163,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 2 @@ -6174,7 +6174,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 3 @@ -6218,7 +6218,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 1 @@ -6229,7 +6229,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 2 @@ -6240,7 +6240,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 3 diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index 5f247a22..f640238f 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -2750,7 +2750,7 @@ Nor would this
- a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) + a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) { "abc", "abcd", "abcde" } contains element 4 @@ -6086,7 +6086,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 1 @@ -6097,7 +6097,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 2 @@ -6108,7 +6108,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 4 > 3 @@ -6152,7 +6152,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 1 @@ -6163,7 +6163,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 2 @@ -6174,7 +6174,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 8 > 3 @@ -6218,7 +6218,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 1 @@ -6229,7 +6229,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 2 @@ -6240,7 +6240,7 @@ C
- 4u * static_cast(i) > str.size() + 4u * static_cast<std::size_t>(i) > str.size() 12 > 3 diff --git a/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp b/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp index cc8c54f8..b3504299 100644 --- a/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp +++ b/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp @@ -75,7 +75,7 @@ TEST_CASE("Basic use of the Contains range matcher", "[matchers][templated][cont SECTION("Different element type, custom comparisons") { std::array a{ { "abc", "abcd" , "abcde" } }; - REQUIRE_THAT(a, Contains(4, [](auto&& lhs, size_t sz) { + REQUIRE_THAT(a, Contains(4u, [](auto&& lhs, size_t sz) { return lhs.size() == sz; })); } @@ -914,4 +914,4 @@ TEST_CASE( "Type conversions of RangeEquals and similar", UnorderedRangeEquals( array_a_plus_1, close_enough ) ); } } -} \ No newline at end of file +}