2022-01-28 18:03:43 -05:00
|
|
|
|
|
|
|
// Copyright Catch2 Authors
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
2022-10-28 05:22:53 -04:00
|
|
|
// (See accompanying file LICENSE.txt or copy at
|
2022-01-28 18:03:43 -05:00
|
|
|
// https://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2017-05-27 08:42:05 -04:00
|
|
|
|
|
|
|
#include <iostream>
|
2017-08-30 05:40:29 -04:00
|
|
|
#include <cstdio>
|
2017-05-27 08:42:05 -04:00
|
|
|
|
2018-07-02 05:13:07 -04:00
|
|
|
namespace {
|
|
|
|
|
2017-05-27 08:42:05 -04:00
|
|
|
struct truthy {
|
|
|
|
truthy(bool b):m_value(b){}
|
|
|
|
operator bool() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
bool m_value;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& o, truthy) {
|
|
|
|
o << "Hey, its truthy!";
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2018-07-02 05:13:07 -04:00
|
|
|
} // end anonymous namespace
|
|
|
|
|
2020-01-20 17:24:04 -05:00
|
|
|
#include <catch2/catch_test_macros.hpp>
|
2017-05-27 08:42:05 -04:00
|
|
|
|
|
|
|
TEST_CASE( "Reconstruction should be based on stringification: #914" , "[Decomposition][failing][.]") {
|
|
|
|
CHECK(truthy(false));
|
|
|
|
}
|
2017-08-30 05:40:29 -04:00
|
|
|
|
2022-01-26 17:47:40 -05:00
|
|
|
TEST_CASE("#1005: Comparing pointer to int and long (NULL can be either on various systems)", "[Decomposition][approvals]") {
|
2017-08-30 05:40:29 -04:00
|
|
|
FILE* fptr = nullptr;
|
2022-11-01 16:38:46 -04:00
|
|
|
REQUIRE( fptr == 0 );
|
|
|
|
REQUIRE_FALSE( fptr != 0 );
|
|
|
|
REQUIRE( fptr == 0l );
|
|
|
|
REQUIRE_FALSE( fptr != 0l );
|
2017-08-30 05:40:29 -04:00
|
|
|
}
|