MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

compute/test/test_find.cpp:29–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace compute = boost::compute;
28
29BOOST_AUTO_TEST_CASE(find_int)
30{
31 int data[] = { 9, 15, 1, 4, 9, 9, 4, 15, 12, 1 };
32 bc::vector<int> vector(data, data + 10, queue);
33
34 bc::vector<int>::iterator iter =
35 bc::find(vector.begin(), vector.end(), 4, queue);
36 BOOST_CHECK(iter == vector.begin() + 3);
37 BOOST_CHECK_EQUAL(*iter, 4);
38
39 iter = bc::find(vector.begin(), vector.end(), 12, queue);
40 BOOST_CHECK(iter == vector.begin() + 8);
41 BOOST_CHECK_EQUAL(*iter, 12);
42
43 iter = bc::find(vector.begin(), vector.end(), 1, queue);
44 BOOST_CHECK(iter == vector.begin() + 2);
45 BOOST_CHECK_EQUAL(*iter, 1);
46
47 iter = bc::find(vector.begin(), vector.end(), 9, queue);
48 BOOST_CHECK(iter == vector.begin());
49 BOOST_CHECK_EQUAL(*iter, 9);
50
51 iter = bc::find(vector.begin(), vector.end(), 100, queue);
52 BOOST_CHECK(iter == vector.end());
53}
54
55BOOST_AUTO_TEST_CASE(find_int2)
56{

Callers

nothing calls this directly

Calls 7

findFunction · 0.85
find_if_notFunction · 0.85
find_ifFunction · 0.85
copy_nFunction · 0.85
CHECK_RANGE_EQUALFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected