You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2021/03/19 10:44:18 UTC

[GitHub] [celix] Oipo commented on a change in pull request #332: Adds some missing async calls.

Oipo commented on a change in pull request #332:
URL: https://github.com/apache/celix/pull/332#discussion_r597568117



##########
File path: libs/framework/gtest/src/CxxBundleContextTestSuite.cc
##########
@@ -78,6 +78,7 @@ TEST_F(CxxBundleContextTestSuite, RegisterServiceTest) {
     }
 
     ctx->waitForEvents();
+    ctx->waitIfAbleForEvents();

Review comment:
       Did you forget to remove line 80?

##########
File path: libs/framework/gtest/src/DependencyManagerTestSuite.cc
##########
@@ -638,4 +639,12 @@ TEST_F(DependencyManagerTestSuite, ExceptionsInLifecycle) {
         //required service -> should stop, but fails at stop and should become inactive (component will disable itself)
         dm.clear(); //dm clear will deinit component and this should fail, but not deadlock
     }
+}
+
+TEST_F(DependencyManagerTestSuite, ComponentContext) {

Review comment:
       Please rename `ComponentContext` to `ComponentContextShouldNotLeak`.

##########
File path: libs/framework/gtest/src/CxxBundleContextTestSuite.cc
##########
@@ -561,3 +565,21 @@ TEST_F(CxxBundleContextTestSuite, setServicesWithTrackerWhenMultipleRegistration
     //Also look into why this is not happening in the C service tracker test.
     EXPECT_EQ(3, count.load());
 }
+
+TEST_F(CxxBundleContextTestSuite, WaitForAllEvents) {
+    long svcId = ctx->findService<TestInterface>();
+    EXPECT_EQ(svcId, -1L);
+
+    {
+        auto impl = std::make_shared<TestImplementation>();
+        auto svcReg = ctx->registerService<TestInterface>(impl).build();
+        svcReg->wait();
+        svcId = ctx->findService<TestInterface>();
+        EXPECT_GE(svcId, 0L);
+    }
+
+    ctx->waitForAllEvents();
+    ctx->waitIfAbleForAllEvents();

Review comment:
       Again a double call here that doesn't look like it adds anything. Copy and paste error or am I missing something?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org