MCPcopy Create free account
hub / github.com/alibaba/async_simple / Dummy

Class Dummy

async_simple/test/TryTest.cpp:38–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38struct Dummy {
39 Dummy() = default;
40 Dummy(int* state_) : state(state_) {
41 if (state) {
42 *state |= CONSTRUCTED;
43 }
44 }
45 Dummy(Dummy&& other) : state(other.state) { other.state = nullptr; }
46 Dummy& operator=(Dummy&& other) {
47 std::swap(other.state, state);
48 return *this;
49 }
50 ~Dummy() {
51 if (state) {
52 *state |= DESTRUCTED;
53 state = nullptr;
54 }
55 }
56 int* state = nullptr;
57};
58} // namespace
59
60TEST_F(TryTest, testSimpleProcess) {

Callers 1

TEST_FFunction · 0.70

Calls 1

swapFunction · 0.50

Tested by 1

TEST_FFunction · 0.56