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