diff options
Diffstat (limited to 'src/tests/common/unique_function.cpp')
| -rw-r--r-- | src/tests/common/unique_function.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/common/unique_function.cpp b/src/tests/common/unique_function.cpp index f7a23e876..42e6ade09 100644 --- a/src/tests/common/unique_function.cpp +++ b/src/tests/common/unique_function.cpp | |||
| @@ -46,8 +46,8 @@ TEST_CASE("UniqueFunction", "[common]") { | |||
| 46 | Noisy noisy; | 46 | Noisy noisy; |
| 47 | REQUIRE(noisy.state == "Default constructed"); | 47 | REQUIRE(noisy.state == "Default constructed"); |
| 48 | 48 | ||
| 49 | Common::UniqueFunction<void> func = [noisy = std::move(noisy)] { | 49 | Common::UniqueFunction<void> func = [noisy_inner = std::move(noisy)] { |
| 50 | REQUIRE(noisy.state == "Move constructed"); | 50 | REQUIRE(noisy_inner.state == "Move constructed"); |
| 51 | }; | 51 | }; |
| 52 | REQUIRE(noisy.state == "Moved away"); | 52 | REQUIRE(noisy.state == "Moved away"); |
| 53 | func(); | 53 | func(); |
| @@ -101,7 +101,7 @@ TEST_CASE("UniqueFunction", "[common]") { | |||
| 101 | }; | 101 | }; |
| 102 | Foo object{&num_destroyed}; | 102 | Foo object{&num_destroyed}; |
| 103 | { | 103 | { |
| 104 | Common::UniqueFunction<void> func = [object = std::move(object)] {}; | 104 | Common::UniqueFunction<void> func = [object_inner = std::move(object)] {}; |
| 105 | REQUIRE(num_destroyed == 0); | 105 | REQUIRE(num_destroyed == 0); |
| 106 | } | 106 | } |
| 107 | REQUIRE(num_destroyed == 1); | 107 | REQUIRE(num_destroyed == 1); |