MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/util_threadnames_tests.cpp:54–70  ·  view source on GitHub ↗

* Rename a bunch of threads with the same basename (expect_multiple=true), ensuring suffixes are * applied properly. */

Source from the content-addressed store, hash-verified

52 * applied properly.
53 */
54BOOST_AUTO_TEST_CASE(util_threadnames_test_rename_threaded)
55{
56#if !defined(HAVE_THREAD_LOCAL)
57 // This test doesn't apply to platforms where we don't have thread_local.
58 return;
59#endif
60
61 std::set<std::string> names = RenameEnMasse(100);
62
63 BOOST_CHECK_EQUAL(names.size(), 100U);
64
65 // Names "test_thread.[n]" should exist for n = [0, 99]
66 for (int i = 0; i < 100; ++i) {
67 BOOST_CHECK(names.find(TEST_THREAD_NAME_BASE + ToString(i)) != names.end());
68 }
69
70}
71
72BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 5

RenameEnMasseFunction · 0.85
findMethod · 0.80
ToStringFunction · 0.50
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected