Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/UsageTests/Misc.tests.cpp
diff options
context:
space:
mode:
authorMartin Jeřábek2024-03-01 11:15:27 +0100
committerMartin Hořeňovský2024-03-01 21:24:45 +0100
commitcde35096641d55b4aa0f743bb03e04703fbb5e9c (patch)
tree7072371d7a380dcac9142a4ef8e701756e3fbcd2 /tests/SelfTest/UsageTests/Misc.tests.cpp
parent7677c1658eb4417ec60649589610bf4e3d731bc9 (diff)
downloadcatch3-cde35096641d55b4aa0f743bb03e04703fbb5e9c.tar.gz
Fix various useful clang-tidy warnings
* bugprone-branch-clone * bugprone-copy-constructor-init * bugprone-empty-catch * bugprone-sizeof-expression * bugprone-switch-missing-default-case * bugprone-unused-local-non-trivial-variable * clang-analyzer-core.uninitialized.Assign * clang-analyzer-cplusplus.Move * clang-analyzer-optin.cplusplus.VirtualCall * modernize-loop-convert * modernize-raw-string-literal * modernize-use-equals-default * modernize-use-override * modernize-use-using * performance-avoid-endl * performance-inefficient-string-concatenation * performance-inefficient-vector-operation * performance-noexcept-move-constructor * performance-unnecessary-value-param (and improve generator example) * readability-duplicate-include * readability-inconsistent-declaration-parameter-name * readability-non-const-parameter * readability-redundant-casting * readability-redundant-member-init * readability-redundant-smartptr-get * readability-static-accessed-through-instance * unused variable in amalgamted tests
Diffstat (limited to 'tests/SelfTest/UsageTests/Misc.tests.cpp')
-rw-r--r--tests/SelfTest/UsageTests/Misc.tests.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/SelfTest/UsageTests/Misc.tests.cpp b/tests/SelfTest/UsageTests/Misc.tests.cpp
index 7f06704b..f08c8ef1 100644
--- a/tests/SelfTest/UsageTests/Misc.tests.cpp
+++ b/tests/SelfTest/UsageTests/Misc.tests.cpp
@@ -158,9 +158,9 @@ TEST_CASE( "looped tests", "[.][failing]" ) {
}
TEST_CASE( "Sends stuff to stdout and stderr", "[.]" ) {
- std::cout << "A string sent directly to stdout" << std::endl;
- std::cerr << "A string sent directly to stderr" << std::endl;
- std::clog << "A string sent to stderr via clog" << std::endl;
+ std::cout << "A string sent directly to stdout\n" << std::flush;
+ std::cerr << "A string sent directly to stderr\n" << std::flush;
+ std::clog << "A string sent to stderr via clog\n" << std::flush;
}
TEST_CASE( "null strings" ) {
@@ -396,7 +396,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product
using MyTypes = std::tuple<int, char, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
{
- REQUIRE(sizeof(TestType) > 0);
+ REQUIRE(std::is_arithmetic<TestType>::value);
}
struct NonDefaultConstructibleType {
@@ -406,7 +406,7 @@ struct NonDefaultConstructibleType {
using MyNonDefaultConstructibleTypes = std::tuple<NonDefaultConstructibleType, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes)
{
- REQUIRE(sizeof(TestType) > 0);
+ REQUIRE(std::is_trivially_copyable<TestType>::value);
}
struct NonCopyableAndNonMovableType {
@@ -421,7 +421,7 @@ struct NonCopyableAndNonMovableType {
using NonCopyableAndNonMovableTypes = std::tuple<NonCopyableAndNonMovableType, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-copyable and non-movable std::tuple", "[template][list]", NonCopyableAndNonMovableTypes)
{
- REQUIRE(sizeof(TestType) > 0);
+ REQUIRE(std::is_default_constructible<TestType>::value);
}
// https://github.com/philsquared/Catch/issues/166