#include "boost/test/unit_test.hpp"
#include "cetlib/pow.h"
Go to the source code of this file.
#define BOOST_TEST_MODULE (pow test) |
BOOST_AUTO_TEST_CASE |
( |
zero |
| ) |
|
Definition at line 15 of file pow_test.cc.
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);
BOOST_AUTO_TEST_CASE |
( |
one |
| ) |
|
Definition at line 28 of file pow_test.cc.
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);
BOOST_AUTO_TEST_CASE |
( |
two |
| ) |
|
Definition at line 42 of file pow_test.cc.
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);
BOOST_AUTO_TEST_CASE |
( |
diffs |
| ) |
|
Definition at line 56 of file pow_test.cc.
constexpr T diff_of_squares(T x, T y)
BOOST_AUTO_TEST_CASE |
( |
sum2s |
| ) |
|
Definition at line 66 of file pow_test.cc.
constexpr T sum_of_squares(T x, T y)
BOOST_AUTO_TEST_CASE |
( |
sum3s |
| ) |
|
Definition at line 76 of file pow_test.cc.
constexpr T sum_of_squares(T x, T y)