1#include <xrpl/beast/core/CurrentThreadName.h>
2#include <xrpl/beast/unit_test/suite.h>
4#include <boost/predef/os.h>
32 if (!initialThreadName.empty())
55 char actualName[beast::kMaxThreadNameLength + 1] = {};
56 pthread_getname_np(pthread_self(), actualName,
sizeof(actualName));
58 BEAST_EXPECT(
std::string(actualName) == expectedName);
81 while (stateA == 0 || stateB == 0)
89 BEAST_EXPECT(stateA == 2);
90 BEAST_EXPECT(stateB == 2);
97 testName(
"123456789012345",
100 testName(
"short",
"short");
static void exerciseName(std::string myName, std::atomic< bool > *stop, std::atomic< int > *state)
void run() override
Runs the suite.
void setCurrentThreadName(std::string_view newThreadName)
Changes the name of the caller thread.
std::string getCurrentThreadName()
Returns the name of the caller thread.
BEAST_DEFINE_TESTSUITE(AMMClawback, app, xrpl)