Debian Codegraph @

src/external/catch2/tests/SelfTest/UsageTests/Decomposition.tests.cpp

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