+
+int UtcDaliFrameCallbackDestroyedBeforeRemoving(void)
+{
+ // Ensure there's no segmentation fault if the callback is deleted without being removed
+
+ TestApplication application;
+ Stage stage = Stage::GetCurrent();
+
+ Actor actor = Actor::New();
+ stage.Add( actor );
+
+ {
+ FrameCallbackBasic frameCallback;
+ DevelStage::AddFrameCallback( stage, frameCallback, actor );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+ frameCallback.Reset();
+ }
+
+ // frameCallback has now been destroyed but not removed
+
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK( true ); // If it runs to here then there's no segmentation fault
+
+ END_TEST;
+}
+
+int UtcDaliFrameCallbackDoubleAddition(void)
+{
+ // Ensure we don't connect the same frame-callback twice
+
+ TestApplication application;
+ Stage stage = Stage::GetCurrent();
+ Actor rootActor = stage.GetRootLayer();
+
+ FrameCallbackBasic frameCallback;
+ DevelStage::AddFrameCallback( stage, frameCallback, rootActor );
+
+ try
+ {
+ DevelStage::AddFrameCallback( stage, frameCallback, rootActor );
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( true );
+ }
+
+ END_TEST;
+}