]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | // |
2 | // Test BOOST_TEST_EQ( p, nullptr ) | |
3 | // | |
4 | // Copyright 2017 Peter Dimov | |
5 | // | |
6 | // Distributed under the Boost Software License, Version 1.0. | |
7 | // See accompanying file LICENSE_1_0.txt or copy at | |
8 | // http://www.boost.org/LICENSE_1_0.txt | |
9 | // | |
10 | ||
11 | #include <boost/config.hpp> | |
12 | #include <boost/core/lightweight_test.hpp> | |
13 | ||
14 | int main() | |
15 | { | |
16 | #if !defined( BOOST_NO_CXX11_NULLPTR ) | |
17 | ||
18 | int x = 0; | |
19 | int* p1 = 0; | |
20 | int* p2 = &x; | |
21 | ||
22 | BOOST_TEST_EQ( p1, nullptr ); | |
23 | BOOST_TEST_NE( p2, nullptr ); | |
24 | ||
92f5a8d4 TL |
25 | BOOST_TEST_EQ( nullptr, p1 ); |
26 | BOOST_TEST_NE( nullptr, p2 ); | |
27 | ||
b32b8144 FG |
28 | #endif |
29 | ||
30 | return boost::report_errors(); | |
31 | } |