aboutsummaryrefslogtreecommitdiff
path: root/src/test/util_threadnames_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/util_threadnames_tests.cpp')
-rw-r--r--src/test/util_threadnames_tests.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/util_threadnames_tests.cpp b/src/test/util_threadnames_tests.cpp
index 78dbf848bb..4dcc080b2d 100644
--- a/src/test/util_threadnames_tests.cpp
+++ b/src/test/util_threadnames_tests.cpp
@@ -1,14 +1,15 @@
-// Copyright (c) 2018-2019 The Bitcoin Core developers
+// Copyright (c) 2018-2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include <util/threadnames.h>
#include <test/util/setup_common.h>
+#include <util/string.h>
+#include <util/threadnames.h>
+#include <mutex>
+#include <set>
#include <thread>
#include <vector>
-#include <set>
-#include <mutex>
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
@@ -32,7 +33,7 @@ std::set<std::string> RenameEnMasse(int num_threads)
std::mutex lock;
auto RenameThisThread = [&](int i) {
- util::ThreadRename(TEST_THREAD_NAME_BASE + std::to_string(i));
+ util::ThreadRename(TEST_THREAD_NAME_BASE + ToString(i));
std::lock_guard<std::mutex> guard(lock);
names.insert(util::ThreadGetInternalName());
};
@@ -61,11 +62,11 @@ BOOST_AUTO_TEST_CASE(util_threadnames_test_rename_threaded)
std::set<std::string> names = RenameEnMasse(100);
- BOOST_CHECK_EQUAL(names.size(), 100);
+ BOOST_CHECK_EQUAL(names.size(), 100U);
// Names "test_thread.[n]" should exist for n = [0, 99]
for (int i = 0; i < 100; ++i) {
- BOOST_CHECK(names.find(TEST_THREAD_NAME_BASE + std::to_string(i)) != names.end());
+ BOOST_CHECK(names.find(TEST_THREAD_NAME_BASE + ToString(i)) != names.end());
}
}