mirror of
https://github.com/boostorg/core.git
synced 2025-11-30 06:09:56 +01:00
Revert "report_errors with expected failures (#51)"
This reverts commit 02041f6c9f and
https://github.com/boostorg/core/pull/51.
Reason for revert: The change allows for incorrect result code returned
from the process if the number of failures is a multiple of 256. This
may result in test failures being taken as success by the parent process.
This commit is contained in:
68
test/lightweight_test_test5.cpp
Normal file
68
test/lightweight_test_test5.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// Negative test for BOOST_TEST_TRAIT_SAME
|
||||
//
|
||||
// Copyright 2014, 2019 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
template<class T1, class T2> struct Y
|
||||
{
|
||||
typedef T1 type;
|
||||
};
|
||||
|
||||
typedef int I1;
|
||||
typedef const int I2;
|
||||
typedef volatile int I3;
|
||||
typedef const volatile int I4;
|
||||
typedef int& I5;
|
||||
typedef const int& I6;
|
||||
typedef volatile int& I7;
|
||||
typedef const volatile int& I8;
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
typedef int&& I9;
|
||||
typedef const int&& I10;
|
||||
typedef volatile int&& I11;
|
||||
typedef const volatile int&& I12;
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(char[1], char[2]);
|
||||
BOOST_TEST_TRAIT_SAME(char[1], char[]);
|
||||
BOOST_TEST_TRAIT_SAME(char[1], char*);
|
||||
BOOST_TEST_TRAIT_SAME(void(), void(int));
|
||||
BOOST_TEST_TRAIT_SAME(void(), void(*)());
|
||||
BOOST_TEST_TRAIT_SAME(X, void);
|
||||
BOOST_TEST_TRAIT_SAME(X::type, void);
|
||||
BOOST_TEST_TRAIT_SAME(X, Y<void, void>);
|
||||
BOOST_TEST_TRAIT_SAME(X::type, Y<float, int>::type);
|
||||
BOOST_TEST_TRAIT_SAME(Y<int, float>, Y<int, double>);
|
||||
BOOST_TEST_TRAIT_SAME(I1, I2);
|
||||
BOOST_TEST_TRAIT_SAME(I3, I4);
|
||||
BOOST_TEST_TRAIT_SAME(I5, I6);
|
||||
BOOST_TEST_TRAIT_SAME(I7, I8);
|
||||
|
||||
int expected = 14;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(I9, I10);
|
||||
BOOST_TEST_TRAIT_SAME(I11, I12);
|
||||
|
||||
expected += 2;
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors() == expected;
|
||||
}
|
||||
Reference in New Issue
Block a user