// Positive test case for a method int UtcDaliShadowViewActivateDeactivate(void) { ToolkitTestApplication application; tet_infoline("UtcDaliShadowViewActivateDeactivate"); Toolkit::ShadowView view = Toolkit::ShadowView::New(); DALI_TEST_CHECK( view ); RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); DALI_TEST_CHECK( 1u == taskList.GetTaskCount() ); view.SetParentOrigin(ParentOrigin::CENTER); view.SetSize(Stage::GetCurrent().GetSize()); view.Add(Actor::New()); Stage::GetCurrent().Add(view); view.Activate(); RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList(); DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() ); view.Deactivate(); RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList(); DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() ); END_TEST; }
// Negative test case for a method static void UtcDaliShadowViewUninitialized() { ToolkitTestApplication application; tet_infoline("UtcDaliShadowViewUninitialized"); Toolkit::ShadowView view; try { // New() must be called to create a GaussianBlurView or it wont be valid. Actor a = Actor::New(); view.Add( a ); DALI_TEST_CHECK( false ); } catch (Dali::DaliException& e) { // Tests that a negative test of an assertion succeeds tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str()); DALI_TEST_CHECK(!view); } }
// Negative test case for a method int UtcDaliShadowViewUninitialized(void) { ToolkitTestApplication application; tet_infoline("UtcDaliShadowViewUninitialized"); Toolkit::ShadowView view; try { // New() must be called to create a GaussianBlurView or it wont be valid. Actor a = Actor::New(); view.Add( a ); DALI_TEST_CHECK( false ); } catch (Dali::DaliException& e) { // Tests that a negative test of an assertion succeeds DALI_TEST_PRINT_ASSERT( e ); DALI_TEST_CHECK(!view); } END_TEST; }
// Positive test case for a method static void UtcDaliShadowViewAddRemove() { ToolkitTestApplication application; tet_infoline("UtcDaliShadowViewAddRemove"); Toolkit::ShadowView view = Toolkit::ShadowView::New(); DALI_TEST_CHECK( view ); Actor actor = Actor::New(); DALI_TEST_CHECK( !actor.OnStage() ); view.SetParentOrigin(ParentOrigin::CENTER); view.SetSize(Stage::GetCurrent().GetSize()); view.Add(actor); Stage::GetCurrent().Add(view); DALI_TEST_CHECK( actor.OnStage() ); view.Remove(actor); DALI_TEST_CHECK( !actor.OnStage() ); }