* Rename a bunch of threads with the same basename (expect_multiple=true), ensuring suffixes are * applied properly. */
| 52 | * applied properly. |
| 53 | */ |
| 54 | BOOST_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 | |
| 72 | BOOST_AUTO_TEST_SUITE_END() |
nothing calls this directly
no test coverage detected