Revert "[Tizen] Ensure the processor unregistered during the callback is not executed"
authorseungho <sbsh.baek@samsung.com>
Wed, 21 Sep 2022 04:21:14 +0000 (13:21 +0900)
committerseungho <sbsh.baek@samsung.com>
Wed, 21 Sep 2022 04:21:14 +0000 (13:21 +0900)
This reverts commit 083afb453035d7de9069464b2c0402402ac1bd0d.

automated-tests/src/dali/utc-Dali-Processors.cpp
dali/internal/common/core-impl.cpp

index c118011..0d1b864 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,32 +39,6 @@ public:
   bool processRun;
 };
 
-class NewTestProcessor : public TestProcessor
-{
-public:
-  NewTestProcessor(Integration::Core& core)
-  : core(core)
-  {
-  }
-
-  virtual void Process(bool postProcessor)
-  {
-    processRun = true;
-    if(unregisterProcessor)
-    {
-      core.UnregisterProcessor(*unregisterProcessor, postProcessor);
-    }
-  }
-
-  void SetProcessorToUnregister(Integration::Processor* processor)
-  {
-    unregisterProcessor = processor;
-  }
-
-  Integration::Processor* unregisterProcessor{nullptr};
-  Integration::Core&      core;
-};
-
 int UtcDaliCoreProcessorP(void)
 {
   TestApplication application;
@@ -175,88 +149,4 @@ int UtcDaliCorePostProcessorP(void)
   DALI_TEST_CHECK(testProcessor.processRun == false);
 
   END_TEST;
-}
-
-int UtcDaliCoreProcessorUnregisterDuringCallback01(void)
-{
-  // Test pre-processor
-  TestApplication    application;
-  Integration::Core& core = application.GetCore();
-
-  NewTestProcessor testProcessor1(core);
-  TestProcessor    testProcessor2;
-  TestProcessor    testProcessor3;
-
-  core.RegisterProcessor(testProcessor1);
-  core.RegisterProcessor(testProcessor2);
-  core.RegisterProcessor(testProcessor3);
-
-  DALI_TEST_CHECK(testProcessor1.processRun == false);
-  DALI_TEST_CHECK(testProcessor2.processRun == false);
-  DALI_TEST_CHECK(testProcessor3.processRun == false);
-
-  application.SendNotification();
-
-  tet_infoline("Test that the processors have been executed:");
-  DALI_TEST_CHECK(testProcessor1.processRun);
-  DALI_TEST_CHECK(testProcessor2.processRun);
-  DALI_TEST_CHECK(testProcessor3.processRun);
-
-  // Clear down for next part of test
-  testProcessor1.processRun = false;
-  testProcessor2.processRun = false;
-  testProcessor3.processRun = false;
-
-  testProcessor1.SetProcessorToUnregister(&testProcessor3);
-
-  tet_infoline("Test that the processor unregistered during the callback has not been executed");
-  application.SendNotification();
-
-  DALI_TEST_CHECK(testProcessor1.processRun);
-  DALI_TEST_CHECK(testProcessor2.processRun);
-  DALI_TEST_CHECK(!testProcessor3.processRun);
-
-  END_TEST;
-}
-
-int UtcDaliCoreProcessorUnregisterDuringCallback02(void)
-{
-  // Test post-processor
-  TestApplication    application;
-  Integration::Core& core = application.GetCore();
-
-  NewTestProcessor testProcessor1(core);
-  TestProcessor    testProcessor2;
-  TestProcessor    testProcessor3;
-
-  core.RegisterProcessor(testProcessor1, true);
-  core.RegisterProcessor(testProcessor2, true);
-  core.RegisterProcessor(testProcessor3, true);
-
-  DALI_TEST_CHECK(testProcessor1.processRun == false);
-  DALI_TEST_CHECK(testProcessor2.processRun == false);
-  DALI_TEST_CHECK(testProcessor3.processRun == false);
-
-  application.SendNotification();
-
-  tet_infoline("Test that the processors have been executed:");
-  DALI_TEST_CHECK(testProcessor1.processRun);
-  DALI_TEST_CHECK(testProcessor2.processRun);
-  DALI_TEST_CHECK(testProcessor3.processRun);
-
-  // Clear down for next part of test
-  testProcessor1.processRun = false;
-  testProcessor2.processRun = false;
-  testProcessor3.processRun = false;
-
-  testProcessor1.SetProcessorToUnregister(&testProcessor3);
-
-  tet_infoline("Test that the processor unregistered during the callback has not been executed");
-  application.SendNotification();
-
-  DALI_TEST_CHECK(testProcessor1.processRun);
-  DALI_TEST_CHECK(testProcessor2.processRun);
-  DALI_TEST_CHECK(!testProcessor3.processRun);
-
-  END_TEST;
-}
+}
\ No newline at end of file
index dd9917b..5e02c36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -368,13 +368,7 @@ void Core::RunProcessors()
   {
     if(processor)
     {
-      // Run processor if the processor is still in the list.
-      // It may be removed during the loop.
-      auto iter = std::find(mProcessors.Begin(), mProcessors.End(), processor);
-      if(iter != mProcessors.End())
-      {
-        processor->Process(false);
-      }
+      processor->Process(false);
     }
   }
 }
@@ -388,13 +382,7 @@ void Core::RunPostProcessors()
   {
     if(processor)
     {
-      // Run processor if the processor is still in the list.
-      // It may be removed during the loop.
-      auto iter = std::find(mPostProcessors.Begin(), mPostProcessors.End(), processor);
-      if(iter != mPostProcessors.End())
-      {
-        processor->Process(true);
-      }
+      processor->Process(true);
     }
   }
 }