MCPcopy Create free account
hub / github.com/boostorg/histogram / run_tests

Function run_tests

test/histogram_test.cpp:42–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <typename Tag>
42void run_tests() {
43 // init_1
44 {
45 auto h = make(Tag(), axis::regular<>{3, -1, 1});
46 BOOST_TEST_EQ(h.dim(), 1);
47 BOOST_TEST_EQ(h.size(), 5);
48 BOOST_TEST_EQ(h.axis(0_c).shape(), 5);
49 BOOST_TEST_EQ(h.axis().shape(), 5);
50 auto h2 = make_s(Tag(), array_storage<unsigned>(), axis::regular<>{3, -1, 1});
51 BOOST_TEST_EQ(h2, h);
52 }
53
54 // init_2
55 {
56 auto h = make(Tag(), axis::regular<>{3, -1, 1}, axis::integer<>{-1, 2});
57 BOOST_TEST_EQ(h.dim(), 2);
58 BOOST_TEST_EQ(h.size(), 25);
59 BOOST_TEST_EQ(h.axis(0_c).shape(), 5);
60 BOOST_TEST_EQ(h.axis(1_c).shape(), 5);
61 auto h2 = make_s(Tag(), array_storage<unsigned>(), axis::regular<>{3, -1, 1},
62 axis::integer<>{-1, 2});
63 BOOST_TEST_EQ(h2, h);
64 }
65
66 // init_3
67 {
68 auto h = make(Tag(), axis::regular<>{3, -1, 1}, axis::integer<>{-1, 2},
69 axis::circular<>{3});
70 BOOST_TEST_EQ(h.dim(), 3);
71 BOOST_TEST_EQ(h.size(), 75);
72 auto h2 = make_s(Tag(), array_storage<unsigned>(), axis::regular<>{3, -1, 1},
73 axis::integer<>{-1, 2}, axis::circular<>{3});
74 BOOST_TEST_EQ(h2, h);
75 }
76
77 // init_4
78 {
79 auto h = make(Tag(), axis::regular<>{3, -1, 1}, axis::integer<>{-1, 2},
80 axis::circular<>{3}, axis::variable<>{-1, 0, 1});
81 BOOST_TEST_EQ(h.dim(), 4);
82 BOOST_TEST_EQ(h.size(), 300);
83 auto h2 =
84 make_s(Tag(), array_storage<unsigned>(), axis::regular<>{3, -1, 1},
85 axis::integer<>{-1, 2}, axis::circular<>{3}, axis::variable<>{-1, 0, 1});
86 BOOST_TEST_EQ(h2, h);
87 }
88
89 // init_5
90 {
91 enum { A, B, C };
92 auto h = make(Tag(), axis::regular<>{3, -1, 1}, axis::integer<>{-1, 2},
93 axis::circular<>{3}, axis::variable<>{-1, 0, 1},
94 axis::category<>{{A, B, C}});
95 BOOST_TEST_EQ(h.dim(), 5);
96 BOOST_TEST_EQ(h.size(), 1200);
97 auto h2 = make_s(Tag(), array_storage<unsigned>(), axis::regular<>{3, -1, 1},
98 axis::integer<>{-1, 2}, axis::circular<>{3},
99 axis::variable<>{-1, 0, 1}, axis::category<>{{A, B, C}});

Callers

nothing calls this directly

Calls 15

makeFunction · 0.85
make_sFunction · 0.85
expected_moved_from_dimFunction · 0.85
weightFunction · 0.85
pass_histogramFunction · 0.85
axisMethod · 0.80
upperMethod · 0.80
atMethod · 0.80
reduce_toMethod · 0.80
binMethod · 0.80
sumFunction · 0.70
custom_axisClass · 0.70

Tested by

no test coverage detected