Decomposition.tests.cpp 915 B

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