1 #define BOOST_TEST_MODULE (pow test) 2 #include "boost/test/unit_test.hpp" 13 BOOST_AUTO_TEST_SUITE(pow_test)
17 BOOST_TEST(pow<1>(0) == 0);
18 BOOST_TEST(pow<2>(0u) == 0u);
19 BOOST_TEST(
square(0.0) == 0.0);
20 BOOST_TEST(pow<3>(0.0F) == 0.0F);
21 BOOST_TEST(
cube(0.0L) == 0.0L);
22 BOOST_TEST(pow<4>(0UL) == 0UL);
23 BOOST_TEST(
fourth(0UL) == 0UL);
24 BOOST_TEST(pow<5>(0L) == 0L);
25 BOOST_TEST(pow<9>(0.0) == 0.0);
30 BOOST_TEST(pow<0>(1) == 1);
31 BOOST_TEST(pow<1>(1) == 1);
32 BOOST_TEST(pow<2>(1u) == 1u);
33 BOOST_TEST(
square(1.0) == 1.0);
34 BOOST_TEST(pow<3>(1.0F) == 1.0F);
35 BOOST_TEST(
cube(1.0L) == 1.0L);
36 BOOST_TEST(pow<4>(1UL) == 1UL);
37 BOOST_TEST(
fourth(1UL) == 1UL);
38 BOOST_TEST(pow<5>(1L) == 1L);
39 BOOST_TEST(pow<9>(1.0) == 1.0);
44 BOOST_TEST(pow<0>(2) == 1);
45 BOOST_TEST(pow<1>(2) == 2);
46 BOOST_TEST(pow<2>(2u) == 4u);
47 BOOST_TEST(
square(2.0) == 4.0);
48 BOOST_TEST(pow<3>(2.0F) == 8.0F);
49 BOOST_TEST(
cube(2.0L) == 8.0L);
50 BOOST_TEST(pow<4>(2UL) == 16UL);
51 BOOST_TEST(
fourth(2UL) == 16UL);
52 BOOST_TEST(pow<5>(2L) == 32L);
53 BOOST_TEST(pow<9>(2.0) == 512.0);
86 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(zero)
constexpr T diff_of_squares(T x, T y)
constexpr T sum_of_squares(T x, T y)