native_api.cpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright (c) 2011 Helge Bahmann
  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. #include <boost/atomic.hpp>
  7. #include <boost/config.hpp>
  8. #include <boost/cstdint.hpp>
  9. #include "api_test_helpers.hpp"
  10. int main(int, char *[])
  11. {
  12. test_flag_api();
  13. test_integral_api<char>();
  14. test_integral_api<signed char>();
  15. test_integral_api<unsigned char>();
  16. test_integral_api<boost::uint8_t>();
  17. test_integral_api<boost::int8_t>();
  18. test_integral_api<short>();
  19. test_integral_api<unsigned short>();
  20. test_integral_api<boost::uint16_t>();
  21. test_integral_api<boost::int16_t>();
  22. test_integral_api<int>();
  23. test_integral_api<unsigned int>();
  24. test_integral_api<boost::uint32_t>();
  25. test_integral_api<boost::int32_t>();
  26. test_integral_api<long>();
  27. test_integral_api<unsigned long>();
  28. test_integral_api<boost::uint64_t>();
  29. test_integral_api<boost::int64_t>();
  30. test_integral_api<long long>();
  31. test_integral_api<unsigned long long>();
  32. #if defined(BOOST_HAS_INT128)
  33. test_integral_api<boost::int128_type>();
  34. test_integral_api<boost::uint128_type>();
  35. #endif
  36. test_constexpr_ctor<char>();
  37. test_constexpr_ctor<short>();
  38. test_constexpr_ctor<int>();
  39. test_constexpr_ctor<long>();
  40. test_constexpr_ctor<int*>();
  41. #if !defined(BOOST_ATOMIC_NO_FLOATING_POINT)
  42. test_floating_point_api<float>();
  43. test_floating_point_api<double>();
  44. test_floating_point_api<long double>();
  45. #if (defined(BOOST_HAS_INT128) || !defined(BOOST_NO_ALIGNMENT)) && defined(BOOST_HAS_FLOAT128)
  46. test_floating_point_api<boost::float128_type>();
  47. #endif
  48. #endif
  49. test_pointer_api<int>();
  50. test_enum_api();
  51. test_struct_api<test_struct<boost::uint8_t> >();
  52. test_struct_api<test_struct<boost::uint16_t> >();
  53. test_struct_api<test_struct<boost::uint32_t> >();
  54. test_struct_api<test_struct<boost::uint64_t> >();
  55. #if defined(BOOST_HAS_INT128)
  56. test_struct_api<test_struct<boost::uint128_type> >();
  57. #endif
  58. // https://svn.boost.org/trac/boost/ticket/10994
  59. test_struct_x2_api<test_struct_x2<boost::uint64_t> >();
  60. // https://svn.boost.org/trac/boost/ticket/9985
  61. test_struct_api<test_struct<double> >();
  62. test_large_struct_api();
  63. // Test that boost::atomic<T> only requires T to be trivially copyable.
  64. // Other non-trivial constructors are allowed.
  65. test_struct_with_ctor_api();
  66. return boost::report_errors();
  67. }