MCPcopy Create free account
hub / github.com/boostorg/compute / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/test_count.cpp:32–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace compute = boost::compute;
31
32BOOST_AUTO_TEST_CASE(count_int)
33{
34 int data[] = { 1, 2, 1, 2, 3 };
35 bc::vector<int> vector(data, data + 5, queue);
36 BOOST_CHECK_EQUAL(bc::count(vector.begin(), vector.end(), 1, queue), size_t(2));
37 BOOST_CHECK_EQUAL(bc::count(vector.begin(), vector.end(), 2, queue), size_t(2));
38 BOOST_CHECK_EQUAL(bc::count(vector.begin(), vector.end(), 3, queue), size_t(1));
39 BOOST_CHECK_EQUAL(bc::count(vector.begin() + 1, vector.end(), 1, queue), size_t(1));
40 BOOST_CHECK_EQUAL(bc::count(vector.begin() + 1, vector.end() - 1, 3, queue), size_t(0));
41 BOOST_CHECK_EQUAL(bc::count(vector.begin() + 1, vector.end() - 1, 2, queue), size_t(2));
42}
43
44BOOST_AUTO_TEST_CASE(count_constant_int_range)
45{

Callers

nothing calls this directly

Calls 9

countFunction · 0.85
make_constant_iteratorFunction · 0.85
count_ifFunction · 0.85
copyFunction · 0.85
iotaFunction · 0.85
count_if_with_reduceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected