Fix clang errors
- structs used in emplace_back now have defined constructor
- removed dead code from ensure
Testing done:
- CI tests are passing
- UTs are passing
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I3f56a3796e45d608c7a5d3da1f8c2d674d62f567
diff --git a/tests/src/test_ensure.cpp b/tests/src/test_ensure.cpp
index d252bc3..0e300ad 100644
--- a/tests/src/test_ensure.cpp
+++ b/tests/src/test_ensure.cpp
@@ -8,44 +8,22 @@
class TestEnsure : public Test
{
public:
- utils::Ensure<std::function<void()>> makeEnsure()
- {
- return [this] { ++executed; };
- }
-
utils::Ensure<std::function<void()>> sut;
+
size_t executed = 0u;
};
TEST_F(TestEnsure, executesCallbackOnceWhenDestroyed)
{
- sut = makeEnsure();
+ sut = [this] { ++executed; };
sut = nullptr;
EXPECT_THAT(executed, Eq(1u));
}
-TEST_F(TestEnsure, executesCallbackOnceWhenMoved)
-{
- sut = makeEnsure();
- auto copy = std::move(sut);
- copy = nullptr;
-
- EXPECT_THAT(executed, Eq(1u));
-}
-
-TEST_F(TestEnsure, executesCallbackTwiceWhenReplaced)
-{
- sut = makeEnsure();
- sut = makeEnsure();
- sut = nullptr;
-
- EXPECT_THAT(executed, Eq(2u));
-}
-
TEST_F(TestEnsure, executesCallbackTwiceWhenNewCallbackAssigned)
{
- sut = makeEnsure();
+ sut = [this] { ++executed; };
sut = [this] { executed += 10; };
sut = nullptr;