MCPcopy Create free account
hub / github.com/comaps/comaps / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

3party/succinct/test_darray.cpp:35–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35BOOST_AUTO_TEST_CASE(darray)
36{
37 srand(42);
38 size_t N = 10000;
39
40 {
41 // Random bitmap
42 std::vector<bool> v = random_bit_vector(N);
43 test_darray(v, "random");
44 }
45
46 {
47 // Empty bitmap
48 std::vector<bool> v;
49 test_darray(v, "empty");
50 }
51
52 {
53 // Only one value
54 std::vector<bool> v(N);
55 v[37] = 1;
56 test_darray(v, "singleton");
57 }
58
59 {
60 // Full bitmap
61 std::vector<bool> v(N, 1);
62 test_darray(v, "full");
63 }
64
65 {
66 // Very sparse random bitmap
67 size_t bigN = (1 << 16) * 4;
68 std::vector<bool> v(bigN);
69 size_t cur_pos = 0;
70 while(cur_pos < bigN) {
71 v[cur_pos] = 1;
72 cur_pos += rand() % 1024;
73 }
74 test_darray(v, "sparse");
75 }
76}

Callers

nothing calls this directly

Calls 2

random_bit_vectorFunction · 0.85
test_darrayFunction · 0.85

Tested by

no test coverage detected