UTC test coverage
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Stage.cpp
index 0f850e3..b41d9cf 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/integration-api/context-notifier.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/devel-api/dynamics/dynamics.h>
 
 #include <dali-test-suite-utils.h>
 
@@ -155,6 +156,25 @@ struct ContextStatusFunctor
   bool& mCalledFlag;
 };
 
+struct SceneCreatedStatusFunctor
+{
+  SceneCreatedStatusFunctor(bool& calledFlag) : mCalledFlag( calledFlag )
+  {
+    mCalledFlag = false;
+  }
+
+  void operator()()
+  {
+    mCalledFlag = true;
+  }
+  void Reset()
+  {
+    mCalledFlag = false;
+  }
+
+  bool& mCalledFlag;
+};
+
 } // unnamed namespace
 
 
@@ -187,6 +207,17 @@ int UtcDaliStageGetCurrent(void)
   END_TEST;
 }
 
+int UtcDaliStageAssign(void)
+{
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+  Stage stage2;
+  stage2 = stage;
+
+  DALI_TEST_CHECK(stage2);
+  END_TEST;
+}
+
 int UtcDaliStageIsInstalled(void)
 {
   DALI_TEST_CHECK(!Stage::IsInstalled());
@@ -284,6 +315,21 @@ int UtcDaliStageGetDpi03(void)
   END_TEST;
 }
 
+int UtcDaliStageInitializeDynamicsP(void)
+{
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+  DynamicsWorld world = stage.InitializeDynamics( DynamicsWorldConfig::New() );
+
+#if !defined(DYNAMICS_SUPPORT)
+  DALI_TEST_CHECK(true);
+#else
+  DALI_TEST_CHECK( world );
+#endif
+
+  END_TEST;
+}
+
 int UtcDaliStageGetLayerCount(void)
 {
   TestApplication application;
@@ -638,3 +684,19 @@ int UtcDaliStageContextLostRegainedSignals(void)
 
   END_TEST;
 }
+
+int UtcDaliStageSceneCreatedSignal(void)
+{
+  TestApplication app;
+  Stage stage = Stage::GetCurrent();
+
+  bool signalCalled = false;
+  SceneCreatedStatusFunctor sceneCreatedFunctor( signalCalled );
+  stage.SceneCreatedSignal().Connect(&app, sceneCreatedFunctor );
+
+  Integration::Core& core = app.GetCore();
+  core.SceneCreated();
+  DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}