1// Test BOOST_TEST_NE with character types
2//
3// Copyright 2020 Peter Dimov
4// Distributed under the Boost Software License, Version 1.0.
5// https://www.boost.org/LICENSE_1_0.txt
6
7#include <boost/core/lightweight_test.hpp>
8#include <boost/config.hpp>
9
10int main()
11{
12 BOOST_TEST_NE( 'A', 'A' );
13 BOOST_TEST_NE( (char)1, (char)1 );
14 BOOST_TEST_NE( (unsigned char)1, (unsigned char)1 );
15 BOOST_TEST_NE( (signed char)-1, (signed char)-1 );
16
17 BOOST_TEST_NE( L'A', L'A' );
18 BOOST_TEST_NE( (wchar_t)1, (wchar_t)1 );
19
20 int exp = 6;
21
22#if !defined(BOOST_NO_CXX11_CHAR16_T)
23
24 BOOST_TEST_NE( (char16_t)1, (char16_t)1 );
25 ++exp;
26
27#endif
28
29#if !defined(BOOST_NO_CXX11_CHAR32_T)
30
31 BOOST_TEST_NE( (char32_t)1, (char32_t)1 );
32 ++exp;
33
34#endif
35
36 return boost::report_errors() == exp;
37}
38

source code of boost/libs/core/test/lightweight_test_fail15.cpp