| 36 | }; |
| 37 | |
| 38 | struct 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 | |
| 60 | TEST_F(TryTest, testSimpleProcess) { |