MCPcopy Create free account
hub / github.com/HelenOS/helenos / test_future

Method test_future

uspace/lib/cpp/src/__bits/test/future.cpp:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 }
77
78 void future_test::test_future()
79 {
80 std::future<int> f1{};
81 test("default constructed invalid", !f1.valid());
82
83 std::future<int> f2{new std::aux::shared_state<int>{}};
84 test("state constructed valid", f2.valid());
85
86 f1 = std::move(f2);
87 test("move assignment source invalid", !f2.valid());
88 test("move assignment destination valid", f1.valid());
89
90 std::future<int> f3{std::move(f1)};
91 test("move construction source invalid", !f1.valid());
92 test("move construction destination valid", f3.valid());
93 }
94
95 void future_test::test_promise()
96 {

Callers

nothing calls this directly

Calls 2

moveFunction · 0.85
validMethod · 0.45

Tested by

no test coverage detected