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

Function BOOST_AUTO_TEST_CASE

compute/test/test_sort.cpp:38–49  ·  view source on GitHub ↗

test trivial sorting of zero and one element vectors

Source from the content-addressed store, hash-verified

36
37// test trivial sorting of zero and one element vectors
38BOOST_AUTO_TEST_CASE(sort_int_0_and_1)
39{
40 boost::compute::vector<int> vec(context);
41 BOOST_CHECK_EQUAL(vec.size(), size_t(0));
42 BOOST_CHECK(boost::compute::is_sorted(vec.begin(), vec.end(), queue) == true);
43 boost::compute::sort(vec.begin(), vec.end(), queue);
44
45 vec.push_back(11, queue);
46 BOOST_CHECK_EQUAL(vec.size(), size_t(1));
47 BOOST_CHECK(boost::compute::is_sorted(vec.begin(), vec.end(), queue) == true);
48 boost::compute::sort(vec.begin(), vec.end(), queue);
49}
50
51// test sorting of two element int vectors
52BOOST_AUTO_TEST_CASE(sort_int_2)

Callers

nothing calls this directly

Calls 8

is_sortedFunction · 0.85
sortFunction · 0.85
copyFunction · 0.85
push_backMethod · 0.80
CHECK_RANGE_EQUALFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected