MCPcopy Create free account
hub / github.com/Haivision/srt / TEST

Function TEST

test/test_threadname.cpp:9–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace srt;
8
9TEST(ThreadName, GetSet)
10{
11 std::string name("getset");
12 char buf[ThreadName::BUFSIZE * 2];
13
14 memset(buf, 'a', sizeof(buf));
15 ASSERT_EQ(ThreadName::get(buf), true);
16 // ensure doesn't write out-of-range
17 size_t max = ThreadName::BUFSIZE - 1;
18 ASSERT_LE(strlen(buf), max);
19
20 if (ThreadName::DUMMY_IMPL)
21 return;
22
23 ASSERT_EQ(ThreadName::set(name), true);
24 memset(buf, 'a', sizeof(buf));
25 ASSERT_EQ(ThreadName::get(buf), true);
26 ASSERT_EQ(buf, name);
27}
28
29TEST(ThreadName, AutoReset)
30{

Callers

nothing calls this directly

Calls 2

setFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected