13 #define BOOST_TEST_MODULE ( counter_test )
14 #include <boost/test/unit_test.hpp>
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);
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]);
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));
An iterator dereferencing to a counter value.
void test_count_iterator_documentation()
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
void test_counter_documentation()
Test of util::counter and support utilities.
void test_infinite_counter_documentation()
process_name largeant stream1 can override from command line with o or output physics producers generator N