MCPcopy Create free account
hub / github.com/boostorg/leaf / generate_ids

Function generate_ids

test/error_id_test.cpp:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19constexpr int ids_per_thread = 10000;
20
21std::vector<int> generate_ids()
22{
23 std::vector<int> ids;
24 ids.reserve(ids_per_thread);
25 for(int i=0; i!=ids_per_thread-1; ++i)
26 {
27 int id = leaf::detail::new_id();
28 BOOST_TEST_NE(id&1, 0);
29 int last = leaf::detail::current_id();
30 BOOST_TEST_EQ(last, leaf::detail::current_id());
31 BOOST_TEST_NE(last&1, 0);
32 BOOST_TEST_EQ(last, id);
33 ids.push_back(id);
34 }
35 return ids;
36}
37
38int main()
39{

Callers 1

mainFunction · 0.85

Calls 3

new_idFunction · 0.85
current_idFunction · 0.85
reserveMethod · 0.45

Tested by

no test coverage detected