1 // Copyright (c) 2020 Andrey Semashev
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6
7 #include <boost/atomic/ipc_atomic.hpp>
8 #include <boost/atomic/ipc_atomic_flag.hpp>
9 #include <boost/atomic/capabilities.hpp>
10
11 #include <boost/config.hpp>
12 #include <boost/cstdint.hpp>
13
14 #include "api_test_helpers.hpp"
15
main(int,char * [])16 int main(int, char *[])
17 {
18 #if BOOST_ATOMIC_FLAG_LOCK_FREE == 2
19 test_flag_api< boost::ipc_atomic_flag >();
20 #endif
21
22 test_lock_free_integral_api< ipc_atomic_wrapper, boost::uint8_t >();
23 test_lock_free_integral_api< ipc_atomic_wrapper, boost::int8_t >();
24
25 test_lock_free_integral_api< ipc_atomic_wrapper, boost::uint16_t >();
26 test_lock_free_integral_api< ipc_atomic_wrapper, boost::int16_t >();
27
28 test_lock_free_integral_api< ipc_atomic_wrapper, boost::uint32_t >();
29 test_lock_free_integral_api< ipc_atomic_wrapper, boost::int32_t >();
30
31 test_lock_free_integral_api< ipc_atomic_wrapper, boost::uint64_t >();
32 test_lock_free_integral_api< ipc_atomic_wrapper, boost::int64_t >();
33
34 #if defined(BOOST_HAS_INT128) && !defined(BOOST_ATOMIC_TESTS_NO_INT128)
35 test_lock_free_integral_api< ipc_atomic_wrapper, boost::int128_type >();
36 test_lock_free_integral_api< ipc_atomic_wrapper, boost::uint128_type >();
37 #endif
38
39 #if !defined(BOOST_ATOMIC_NO_FLOATING_POINT)
40 test_lock_free_floating_point_api< ipc_atomic_wrapper, float >();
41 test_lock_free_floating_point_api< ipc_atomic_wrapper, double >();
42 test_lock_free_floating_point_api< ipc_atomic_wrapper, long double >();
43 #if defined(BOOST_HAS_FLOAT128) && !defined(BOOST_ATOMIC_TESTS_NO_FLOAT128)
44 test_lock_free_floating_point_api< ipc_atomic_wrapper, boost::float128_type >();
45 #endif
46 #endif
47
48 test_lock_free_pointer_api< ipc_atomic_wrapper, int >();
49
50 test_lock_free_enum_api< ipc_atomic_wrapper >();
51
52 return boost::report_errors();
53 }
54