Test of util::counter()
and support utilities.
More...
#include "larcorealg/CoreUtils/counter.h"
#include <boost/test/unit_test.hpp>
#include <vector>
#include <cstddef>
Go to the source code of this file.
Test of util::counter()
and support utilities.
- Author
- Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
- Date
- April 14, 2019
Definition in file counter_test.cc.
#define BOOST_TEST_MODULE ( counter_test ) |
BOOST_AUTO_TEST_CASE |
( |
counter_testcase |
| ) |
|
Definition at line 131 of file counter_test.cc.
void test_count_iterator_documentation()
void test_counter_documentation()
void test_infinite_counter_documentation()
void test_count_iterator_documentation |
( |
| ) |
|
Definition at line 22 of file counter_test.cc.
38 std::vector<int> data;
47 BOOST_TEST(data.size() == 10U);
48 for (std::size_t i = 0; i < data.size(); ++i) {
50 BOOST_TEST(data[i] == (
int) i);
An iterator dereferencing to a counter value.
void test_counter_documentation |
( |
| ) |
|
Definition at line 58 of file counter_test.cc.
76 std::vector<std::size_t> data;
82 std::vector<std::size_t> control_data;
83 for (std::size_t i = 4; i < 8; ++i) {
84 control_data.push_back(i);
87 BOOST_TEST(data.size() == control_data.size());
88 for (std::size_t i = 0; i < data.size(); ++i) {
89 BOOST_TEST(data[i] == control_data[i]);
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
void test_infinite_counter_documentation |
( |
| ) |
|
Definition at line 96 of file counter_test.cc.
108 std::vector<unsigned char> data;
109 for (
auto ch: util::infinite_counter<unsigned char>()) {
110 if (data.size() >= 512U)
break;
115 constexpr std::size_t
N = 1U << 8 *
sizeof(
unsigned char);
116 static_assert(N == 256U);
118 BOOST_TEST(data.size() == N * 2);
119 for (std::size_t i = 0; i < data.size(); ++i) {
121 BOOST_TEST(data[i] == static_cast<unsigned char>(i % N));
process_name largeant stream1 can override from command line with o or output physics producers generator N