Decomposition.tests.cpp 929 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright Catch2 Authors
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // https://www.boost.org/LICENSE_1_0.txt)
  5. // SPDX-License-Identifier: BSL-1.0
  6. #include <iostream>
  7. #include <cstdio>
  8. namespace {
  9. struct truthy {
  10. truthy(bool b):m_value(b){}
  11. operator bool() const {
  12. return false;
  13. }
  14. bool m_value;
  15. };
  16. std::ostream& operator<<(std::ostream& o, truthy) {
  17. o << "Hey, its truthy!";
  18. return o;
  19. }
  20. } // end anonymous namespace
  21. #include <catch2/catch_test_macros.hpp>
  22. TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decomposition][failing][.]") {
  23. CHECK(truthy(false));
  24. }
  25. TEST_CASE("#1005: Comparing pointer to int and long (NULL can be either on various systems)", "[Decomposition][approvals]") {
  26. FILE* fptr = nullptr;
  27. REQUIRE(fptr == 0);
  28. REQUIRE(fptr == 0l);
  29. }