MCPcopy Create free account
hub / github.com/Kitware/CMake / TEST

Function TEST

Utilities/cmcppdap/src/chan_test.cpp:22–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#include <thread>
21
22TEST(ChanTest, PutTakeClose) {
23 dap::Chan<int> chan;
24 auto thread = std::thread([&] {
25 chan.put(10);
26 chan.put(20);
27 chan.put(30);
28 chan.close();
29 });
30 EXPECT_EQ(chan.take(), dap::optional<int>(10));
31 EXPECT_EQ(chan.take(), dap::optional<int>(20));
32 EXPECT_EQ(chan.take(), dap::optional<int>(30));
33 EXPECT_EQ(chan.take(), dap::optional<int>());
34 thread.join();
35}

Callers

nothing calls this directly

Calls 4

takeMethod · 0.80
joinMethod · 0.80
putMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…