From: David Steele Date: Thu, 1 Dec 2016 17:42:05 +0000 (-0800) Subject: Merge "Remove dead code from tests." into devel/master X-Git-Tag: dali_1.2.17~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75001f7f684e26f1898dcb772e4da2b570e85bcd;hp=8580a4d8cac9e232d55d8d332af0822c3449727f;p=platform%2Fcore%2Fuifw%2Fdali-core.git Merge "Remove dead code from tests." into devel/master --- diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-GeometryBatcher.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-GeometryBatcher.cpp index eb8972f..070bfdb 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-GeometryBatcher.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-GeometryBatcher.cpp @@ -181,14 +181,6 @@ Actor CreateActor( Actor& parent, Shader& shader, TextureSet& textureSet, Vector return actor; } -Actor CreateActor( Vector3 position ) -{ - Actor actor = Actor::New(); - actor.SetPosition( position ); - return actor; -} - - Actor CreateBatchParent( Vector3 pos ) { Actor actor = Actor::New(); @@ -198,15 +190,7 @@ Actor CreateBatchParent( Vector3 pos ) return actor; } -void AddChildren( Actor parent, Actor* children, size_t size ) -{ - for( size_t i = 0; i < size; ++i ) - { - parent.Add( children[i] ); - } -} - -} +} // namespace int UtcDaliGeometryBatcherBatchLevel0(void) { diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp index 034b341..7191eca 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-ResourceClient.cpp @@ -97,26 +97,6 @@ public: static TestTicketObserver testTicketObserver; static TestTicketLifetimeObserver testTicketLifetimeObserver; - -Internal::ImagePtr LoadImage(TestApplication& application, char* name) -{ - Internal::ResourceImagePtr image = Internal::ResourceImage::New( name, Internal::ImageAttributes::DEFAULT_ATTRIBUTES ); - application.SendNotification(); // Flush update messages - application.Render(); // Process resource request - Integration::ResourceRequest* req = application.GetPlatform().GetRequest(); - Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN ); - bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 80,80,80,80 ); - Integration::ResourcePointer resourcePtr(bitmap); // reference it - application.GetPlatform().SetResourceLoaded(req->GetId(), req->GetType()->id, resourcePtr); - application.Render(); // Process LoadComplete - application.SendNotification(); // Process event messages - application.GetPlatform().DiscardRequest(); // Ensure load request is discarded - req=NULL; - application.GetPlatform().ResetTrace(); - return image; -} - - Internal::ResourceTicketPtr CheckLoadBitmap(TestApplication& application, const char* name, int w, int h) { Internal::ResourceClient& resourceClient = Internal::ThreadLocalStorage::Get().GetResourceClient(); diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 0fd328e..e3f1061 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -46,35 +46,6 @@ namespace bool gTouchCallBackCalled=false; bool gHoverCallBackCalled=false; -/** - * Simulates a Down Touch at 25.0, 25.0. - * @param[in] app Test Application instance. - */ -int SimulateTouchForSetOverlayHitTest(TestApplication& app) -{ - app.SendNotification(); - app.Render(1); - app.SendNotification(); - app.Render(1); - - gTouchCallBackCalled = false; - - // simulate a touch event - Dali::Integration::Point point; - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 25.0f, 25.0f ) ); - Dali::Integration::TouchEvent event; - event.AddPoint( point ); - app.ProcessEvent( event ); - - app.SendNotification(); - app.Render(1); - app.SendNotification(); - app.Render(1); - END_TEST; -} - - static bool gTestConstraintCalled; struct TestConstraint @@ -122,13 +93,6 @@ static bool TestCallback3(Actor actor, const HoverEvent& event) END_TEST; } -static Vector3 gSetSize; -static bool gSetSizeCallBackCalled; -void SetSizeCallback( Actor actor, const Vector3& size ) -{ - gSetSizeCallBackCalled = true; - gSetSize = size; -} // validation stuff for onstage & offstage signals static std::vector< std::string > gActorNamesOnOffStage; static int gOnStageCallBackCalled; diff --git a/automated-tests/src/dali/utc-Dali-Geometry.cpp b/automated-tests/src/dali/utc-Dali-Geometry.cpp index 2edfd8e..6fb9b80 100644 --- a/automated-tests/src/dali/utc-Dali-Geometry.cpp +++ b/automated-tests/src/dali/utc-Dali-Geometry.cpp @@ -35,11 +35,6 @@ void geometry_test_cleanup(void) namespace { -void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs ) -{ - current.b = 0.0f; -} - struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; }; PropertyBuffer CreateVertexBuffer( const std::string& aPosition, const std::string& aTexCoord ) diff --git a/automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp b/automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp index f968a76..4da91dc 100644 --- a/automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp +++ b/automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp @@ -22,14 +22,6 @@ using namespace Dali; #include -namespace -{ -void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs ) -{ - current.b = 0.0f; -} -} - void propertyBuffer_test_startup(void) { test_return_value = TET_UNDEF; diff --git a/automated-tests/src/dali/utc-Dali-PropertyValue.cpp b/automated-tests/src/dali/utc-Dali-PropertyValue.cpp index ea4ec5d..99abb22 100644 --- a/automated-tests/src/dali/utc-Dali-PropertyValue.cpp +++ b/automated-tests/src/dali/utc-Dali-PropertyValue.cpp @@ -26,84 +26,6 @@ using namespace Dali; namespace { -void CheckTypeName(const Property::Type& type) -{ - switch(type) - { - case Property::NONE: - { - DALI_TEST_CHECK( "NONE" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::BOOLEAN: - { - DALI_TEST_CHECK( "BOOLEAN" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::FLOAT: - { - DALI_TEST_CHECK( "FLOAT" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::INTEGER: - { - DALI_TEST_CHECK( "INTEGER" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::VECTOR2: - { - DALI_TEST_CHECK( "VECTOR2" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::VECTOR3: - { - DALI_TEST_CHECK( "VECTOR3" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::VECTOR4: - { - DALI_TEST_CHECK( "VECTOR4" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::MATRIX3: - { - DALI_TEST_CHECK( "MATRIX3" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::MATRIX: - { - DALI_TEST_CHECK( "MATRIX" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::RECTANGLE: - { - DALI_TEST_CHECK( "RECTANGLE" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::ROTATION: - { - DALI_TEST_CHECK( "ROTATION" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::STRING: - { - DALI_TEST_CHECK( "STRING" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::ARRAY: - { - DALI_TEST_CHECK( "ARRAY" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - case Property::MAP: - { - DALI_TEST_CHECK( "MAP" == std::string(PropertyTypes::GetName( type ) ) ); - break; - } - } // switch(type) - -} // CheckTypeName - template struct CheckCopyCtorP { diff --git a/automated-tests/src/dali/utc-Dali-RenderTask.cpp b/automated-tests/src/dali/utc-Dali-RenderTask.cpp index 4c592a5..6c0b851 100644 --- a/automated-tests/src/dali/utc-Dali-RenderTask.cpp +++ b/automated-tests/src/dali/utc-Dali-RenderTask.cpp @@ -212,15 +212,6 @@ void FailImageLoad(TestApplication& application, Integration::ResourceId resourc application.GetPlatform().SetResourceLoadFailed(resourceId, Integration::FailureUnknown); } -void ReloadImage(TestApplication& application, ResourceImage image) -{ - application.GetPlatform().ClearReadyResources(); - application.GetPlatform().DiscardRequest(); - application.GetPlatform().ResetTrace(); - application.GetPlatform().SetClosestImageSize(Vector2(80.0f, 80.0f)); // Ensure reload is called. - image.Reload(); -} - RenderTask CreateRenderTask(TestApplication& application, CameraActor offscreenCamera, Actor rootActor, // Reset default render task to point at this actor @@ -2392,81 +2383,6 @@ int UtcDaliRenderTaskOnce05(void) END_TEST; } -#if 0 -//int UtcDaliRenderTaskOnce06(void) -{ - TestApplication application; - - tet_infoline("Testing RenderTask Render Once GlSync\n" - "During RenderOnce, make ready resources unready before sending first finished signal\n" - "PRE: Everything ready.\n" - "POST: Finished signal sent only once"); - - // SETUP A CONTINUOUS OFFSCREEN RENDER TASK - application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); - TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction(); - TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace(); - drawTrace.Enable(true); - - Actor rootActor = Actor::New(); - Stage::GetCurrent().Add( rootActor ); - - CameraActor offscreenCameraActor = CameraActor::New(); - Stage::GetCurrent().Add( offscreenCameraActor ); - Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg"); - Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest(); - Integration::ResourceId imageRequestId = imageRequest->GetId(); - Integration::ResourceTypeId imageType = imageRequest->GetType()->id; - CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete - application.Render(); - - Stage::GetCurrent().Add(secondRootActor); - application.GetPlatform().ClearReadyResources(); - - RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true); - bool finished = false; - RenderTaskFinished renderTaskFinished( finished ); - newTask.FinishedSignal().Connect( &application, renderTaskFinished ); - application.SendNotification(); - - // START PROCESS/RENDER Input, Expected Input, Expected - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) ); - - // CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY - newTask.SetRefreshRate(RenderTask::REFRESH_ONCE); - - // Doesn't work... - ReloadImage(application, secondRootActor.GetImage()); - application.SendNotification(); // Input, Expected Input, Expected - - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - - // FINISH RESOURCE LOADING - CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) ); - application.GetPlatform().ClearReadyResources(); - Integration::GlSyncAbstraction::SyncObject* lastSyncObj = sync.GetLastSyncObject(); - DALI_TEST_CHECK( lastSyncObj != NULL ); - - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - sync.SetObjectSynced( lastSyncObj, true ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, true, true, __LINE__ ) ); - - // Finished rendering - expect no more renders, no more signals: - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - END_TEST; -} -#endif - int UtcDaliRenderTaskOnce07(void) { TestApplication application; @@ -2998,69 +2914,6 @@ int UtcDaliRenderTaskOnceNoSync05(void) END_TEST; } -#if 0 -//int UtcDaliRenderTaskOnceNoSync06(void) -{ - TestApplication application; - - tet_infoline("Testing RenderTask Render Once\n" - "During RenderOnce, make ready resources unready before sending first finished signal\n" - "PRE: Everything ready.\n" - "POST: Finished signal sent only once"); - - // SETUP A CONTINUOUS OFFSCREEN RENDER TASK - application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); - TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace(); - drawTrace.Enable(true); - - Actor rootActor = Actor::New(); - Stage::GetCurrent().Add( rootActor ); - - CameraActor offscreenCameraActor = CameraActor::New(); - Stage::GetCurrent().Add( offscreenCameraActor ); - Actor secondRootActor = CreateLoadingActor(application, "aFile.jpg"); - Integration::ResourceRequest* imageRequest = application.GetPlatform().GetRequest(); - Integration::ResourceId imageRequestId = imageRequest->GetId(); - Integration::ResourceTypeId imageType = imageRequest->GetType()->id; - CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete - application.Render(); - application.GetPlatform().ClearReadyResources(); - - Stage::GetCurrent().Add(secondRootActor); - - RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false); - bool finished = false; - RenderTaskFinished renderTaskFinished( finished ); - newTask.FinishedSignal().Connect( &application, renderTaskFinished ); - application.SendNotification(); - - // START PROCESS/RENDER Input, Expected Input, Expected - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, false, false, __LINE__ ) ); - - // CHANGE TO RENDER ONCE, RESOURCES BECOME NOT READY - newTask.SetRefreshRate(RenderTask::REFRESH_ONCE); - - // Doesn't work... - ReloadImage(application, secondRootActor.GetImage()); - application.SendNotification(); // Input, Expected Input, Expected - - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_EQUALS( secondRootActor.GetImage().GetLoadingState(), Dali::ResourceLoading, TEST_LOCATION); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - - // FINISH RESOURCE LOADING - CompleteImageLoad(application, imageRequestId, imageType); // Need to run update again for this to complete - DALI_TEST_CHECK( UpdateRender(application, drawTrace, true, finished, true, true, __LINE__ ) ); - application.GetPlatform().ClearReadyResources(); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - DALI_TEST_CHECK( UpdateRender(application, drawTrace, false, finished, false, true, __LINE__ ) ); - END_TEST; -} -#endif - int UtcDaliRenderTaskOnceNoSync07(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-Scripting.cpp b/automated-tests/src/dali/utc-Dali-Scripting.cpp index 756176a..2bdfdbc 100644 --- a/automated-tests/src/dali/utc-Dali-Scripting.cpp +++ b/automated-tests/src/dali/utc-Dali-Scripting.cpp @@ -82,14 +82,7 @@ void TestEnumStrings( } } -/// Helper method to create ResourceImage using property -ResourceImage NewResourceImage( const Property::Value& map ) -{ - ResourceImage image = ResourceImage::DownCast( NewImage( map ) ); - return image; -} - -/// Helper method to create ResourceImage using property +/// Helper method to create BufferImage using property BufferImage NewBufferImage( const Property::Value& map ) { BufferImage image = BufferImage::DownCast( NewImage( map ) );