From e642efc6f1be0fa22a3c88b9947006112cc09027 Mon Sep 17 00:00:00 2001 From: taeyoon Date: Tue, 9 Aug 2016 17:02:11 +0900 Subject: [PATCH] Revert "[3.0] Added test cases for public api." This reverts commit 5d87a5570766cf56efcf7926a9b9c8d034c63658. Change-Id: Ia39f5d101a7adda7edfd05b26fc6c9349936d534 --- automated-tests/execute.sh | 12 +- automated-tests/src/dali-devel/utc-Dali-Actor.cpp | 51 +---- .../dali-test-suite-utils/test-native-image.cpp | 15 -- .../dali/dali-test-suite-utils/test-native-image.h | 30 --- automated-tests/src/dali/utc-Dali-BaseHandle.cpp | 1 + .../src/dali/utc-Dali-EncodedBufferImage.cpp | 33 +-- automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp | 74 +------ automated-tests/src/dali/utc-Dali-NativeImage.cpp | 5 +- .../src/dali/utc-Dali-NinePatchImages.cpp | 3 - automated-tests/src/dali/utc-Dali-PropertyMap.cpp | 30 +-- automated-tests/src/dali/utc-Dali-Stage.cpp | 232 --------------------- .../src/dali/utc-Dali-TouchDataProcessing.cpp | 73 +------ .../src/dali/utc-Dali-TouchProcessing.cpp | 11 +- automated-tests/src/dali/utc-Dali-TypeRegistry.cpp | 132 ------------ build/tizen/Makefile.am | 3 +- 15 files changed, 18 insertions(+), 687 deletions(-) diff --git a/automated-tests/execute.sh b/automated-tests/execute.sh index 4ce6fda..7d430c9 100755 --- a/automated-tests/execute.sh +++ b/automated-tests/execute.sh @@ -134,15 +134,9 @@ else output=`build/src/$mod/tct-$mod-core $1` ret=$? if [ $ret -ne 6 ] ; then - if [ $opt_debug -ne 0 ] ; then - echo DEBUGGING: - gdb --args build/src/$mod/tct-$mod-core $1 - - else - echo $output - if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi - fi - exit $ret + echo $output + if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi + exit $ret fi done echo $1 not found diff --git a/automated-tests/src/dali-devel/utc-Dali-Actor.cpp b/automated-tests/src/dali-devel/utc-Dali-Actor.cpp index da30c62..2dab3f2 100644 --- a/automated-tests/src/dali-devel/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali-devel/utc-Dali-Actor.cpp @@ -106,31 +106,7 @@ int UtcDaliActorAddRendererOnStage(void) END_TEST; } -int UtcDaliActorRemoveRendererP1(void) -{ - tet_infoline("Testing Actor::RemoveRenderer"); - TestApplication application; - - Actor actor = Actor::New(); - - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); - - Geometry geometry = Geometry::QUAD(); - Shader shader = CreateShader(); - Renderer renderer = Renderer::New(geometry, shader); - - actor.AddRenderer( renderer ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); - - actor.RemoveRenderer(renderer); - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); - - - END_TEST; -} - -int UtcDaliActorRemoveRendererP2(void) +int UtcDaliActorRemoveRendererP(void) { tet_infoline("Testing Actor::RemoveRenderer"); TestApplication application; @@ -153,28 +129,3 @@ int UtcDaliActorRemoveRendererP2(void) END_TEST; } - - -int UtcDaliActorRemoveRendererN(void) -{ - tet_infoline("Testing Actor::RemoveRenderer"); - TestApplication application; - - Actor actor = Actor::New(); - - DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); - - Geometry geometry = Geometry::QUAD(); - Shader shader = CreateShader(); - Renderer renderer = Renderer::New(geometry, shader); - - actor.AddRenderer( renderer ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); - - actor.RemoveRenderer(10); - DALI_TEST_EQUALS( actor.GetRendererAt(0), renderer, TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); - - END_TEST; -} diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp index 3afe935..135476e 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp @@ -38,19 +38,4 @@ TestNativeImage::~TestNativeImage() { } - -TestNativeImageNoExtPointer TestNativeImageNoExt::New(int width, int height) -{ - return new TestNativeImageNoExt(width, height); -} - -TestNativeImageNoExt::TestNativeImageNoExt(int width, int height) -: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true) -{ -} - -TestNativeImageNoExt::~TestNativeImageNoExt() -{ -} - } // namespace dali diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h index 7724717..f361280 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h +++ b/automated-tests/src/dali/dali-test-suite-utils/test-native-image.h @@ -25,9 +25,7 @@ namespace Dali { class TestNativeImage; -class TestNativeImageNoExt; typedef IntrusivePtr TestNativeImagePointer; -typedef IntrusivePtr TestNativeImageNoExtPointer; class DALI_IMPORT_API TestNativeImageExtension: public Dali::NativeImageInterface::Extension { @@ -67,34 +65,6 @@ public: TestNativeImageExtension* mExtension; }; - -class DALI_IMPORT_API TestNativeImageNoExt : public Dali::NativeImageInterface -{ -public: - static TestNativeImageNoExtPointer New(int width, int height); - - inline void SetGlExtensionCreateResult(bool result){ createResult = result;} - inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;}; - inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; }; - inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;}; - inline virtual void PrepareTexture() {}; - inline virtual unsigned int GetWidth() const {return mWidth;}; - inline virtual unsigned int GetHeight() const {return mHeight;}; - inline virtual bool RequiresBlending() const {return true;}; - -private: - TestNativeImageNoExt(int width, int height); - virtual ~TestNativeImageNoExt(); - - int mWidth; - int mHeight; -public: - int mExtensionCreateCalls; - int mExtensionDestroyCalls; - int mTargetTextureCalls; - bool createResult; -}; - } // Dali #endif diff --git a/automated-tests/src/dali/utc-Dali-BaseHandle.cpp b/automated-tests/src/dali/utc-Dali-BaseHandle.cpp index 865fa5b..bb64130 100644 --- a/automated-tests/src/dali/utc-Dali-BaseHandle.cpp +++ b/automated-tests/src/dali/utc-Dali-BaseHandle.cpp @@ -123,6 +123,7 @@ int UtcDaliBaseHandleConstructorVoid(void) END_TEST; } + int UtcDaliBaseHandleCopyConstructor(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-EncodedBufferImage.cpp b/automated-tests/src/dali/utc-Dali-EncodedBufferImage.cpp index 8586b61..70e6c50 100644 --- a/automated-tests/src/dali/utc-Dali-EncodedBufferImage.cpp +++ b/automated-tests/src/dali/utc-Dali-EncodedBufferImage.cpp @@ -799,7 +799,7 @@ int UtcDaliEncodedBufferImageDownCastP(void) } // Positive test case for constructors: -int UtcDaliEncodedBufferImageNewP1(void) +int UtcDaliEncodedBufferImageNew01(void) { TestApplication application; @@ -827,35 +827,8 @@ int UtcDaliEncodedBufferImageNewP1(void) END_TEST; } -// Positive test case for constructors: -int UtcDaliEncodedBufferImageNewP2(void) -{ - TestApplication application; - - tet_infoline( "UtcDaliEncodedBufferImageNew01() - EncodedBufferImage::New( const uint8_t * const encodedImage, const std::size_t encodedImageByteCount, ImageDimensions size, FittingMode::Type scalingMode, SamplingMode::Type samplingMode, ReleasePolicy releasePol, bool orientationCorrection )" ); - - // Invoke default handle constructor for the Image base class: - Image image; - - DALI_TEST_CHECK( !image ); - - // Trigger image decode to initialise the handle - image = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength, ImageDimensions(), FittingMode::DEFAULT, SamplingMode::DEFAULT ); - - DALI_TEST_CHECK( image ); - - Image image2; - DALI_TEST_CHECK( !image2 ); - // Trigger image decode to initialise the handle - image2 = EncodedBufferImage::New( sEncodedBufferImageDataPNG, sEncodedBufferImageDataPNGLength); - - DALI_TEST_CHECK( image2 ); - END_TEST; -} - - // Negative test case for constructor - null pointer: -int UtcDaliEncodedBufferImageNewN1(void) +int UtcDaliEncodedBufferImageNew02(void) { TestApplication application; @@ -882,7 +855,7 @@ int UtcDaliEncodedBufferImageNewN1(void) } // Negative test case for constructor - zero-length input buffer: -int UtcDaliEncodedBufferImageNewN2(void) +int UtcDaliEncodedBufferImageNew03(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp b/automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp index ff22fb7..23c7880 100644 --- a/automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp +++ b/automated-tests/src/dali/utc-Dali-IntrusivePtr.cpp @@ -73,33 +73,7 @@ public: ++g_destructionCountUnrelated; } }; - -class TestObject : public RefObject -{ -public: - TestObject() - : data(201) - { - } - - TestObject(const TestObject& testObject) - : RefObject(testObject), - data(testObject.data) - { - } - - TestObject& Assign(const TestObject& testObject) - { - RefObject::operator=(testObject); - data = testObject.data; - return *this; - } - - int data; -}; - - -} // Anonymous namespace +} /** * Test that a default constructed pointer is null and harmless. @@ -485,49 +459,3 @@ int UtcDaliIntrusivePtrOperatorNotEqualLeftPointerTU(void) DALI_TEST_EQUALS( operator!=( counted2.Get(), countedSubclass2 ), false, TEST_LOCATION ); END_TEST; } - -int UtcDaliRefObjectCopyConstructor(void) -{ - tet_infoline("Test for Dali::RefObject(const RefObject&)"); - - { - IntrusivePtr testPtr( new TestObject ); - DALI_TEST_EQUALS( testPtr->ReferenceCount(), 1, TEST_LOCATION ); - - const TestObject& testObject=*testPtr.Get(); - { - IntrusivePtr testPtr2( new TestObject(testObject) ); - DALI_TEST_EQUALS( testPtr2->ReferenceCount(), 1, TEST_LOCATION ); - } - DALI_TEST_EQUALS( testPtr->ReferenceCount(), 1, TEST_LOCATION ); - } - END_TEST; -} - - -int UtcDaliRefObjectAssignmentOperator(void) -{ - tet_infoline("Test for Dali::RefObject::operator=(const RefObject&)"); - - { - IntrusivePtr testPtr( new TestObject ); - DALI_TEST_EQUALS( testPtr->ReferenceCount(), 1, TEST_LOCATION ); - - const TestObject& testObject=*testPtr.Get(); - { - IntrusivePtr testPtr2( new TestObject() ); - testPtr->data = 33; - IntrusivePtr testPtr3 = testPtr2; - DALI_TEST_EQUALS( testPtr2->ReferenceCount(), 2, TEST_LOCATION ); - DALI_TEST_EQUALS( testPtr2->data, 201, TEST_LOCATION ); - - TestObject& testObject2 = *testPtr2.Get(); - testObject2 = testObject; - - DALI_TEST_EQUALS( testPtr->ReferenceCount(), 1, TEST_LOCATION ); - DALI_TEST_EQUALS( testPtr2->ReferenceCount(), 2, TEST_LOCATION ); - } - DALI_TEST_EQUALS( testPtr->ReferenceCount(), 1, TEST_LOCATION ); - } - END_TEST; -} diff --git a/automated-tests/src/dali/utc-Dali-NativeImage.cpp b/automated-tests/src/dali/utc-Dali-NativeImage.cpp index e143837..2b59b92 100644 --- a/automated-tests/src/dali/utc-Dali-NativeImage.cpp +++ b/automated-tests/src/dali/utc-Dali-NativeImage.cpp @@ -207,11 +207,8 @@ int UtcDaliNativeImageExtensionP(void) TestNativeImagePointer testNativeImage = TestNativeImage::New( 16, 16 ); DALI_TEST_CHECK( testNativeImage ); - DALI_TEST_CHECK( NULL != testNativeImage->GetExtension() ); - TestNativeImageNoExtPointer testNativeImage2 = TestNativeImageNoExt::New( 16, 16 ); - DALI_TEST_CHECK( testNativeImage2 ); - DALI_TEST_CHECK( NULL == testNativeImage2->GetExtension() ); + DALI_TEST_CHECK( NULL != testNativeImage->GetExtension() ); END_TEST; } diff --git a/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp b/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp index 97f4ee3..8885918 100644 --- a/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp +++ b/automated-tests/src/dali/utc-Dali-NinePatchImages.cpp @@ -263,9 +263,6 @@ int UtcDaliNinePatchImageGetStrechBorders(void) tet_printf("stretchBorders left(%f) right(%f) top(%f) bottom(%f)\n", stretchBorders.x, stretchBorders.z, stretchBorders.y, stretchBorders.w ); DALI_TEST_CHECK( stretchBorders == requiredStretchBorder ); - - Vector4 actualStretchBorders = ninePatchImage.GetStretchBorders(); - DALI_TEST_EQUALS( actualStretchBorders, requiredStretchBorder, 0.001, TEST_LOCATION ); } else { diff --git a/automated-tests/src/dali/utc-Dali-PropertyMap.cpp b/automated-tests/src/dali/utc-Dali-PropertyMap.cpp index bb17787..f9cae36 100644 --- a/automated-tests/src/dali/utc-Dali-PropertyMap.cpp +++ b/automated-tests/src/dali/utc-Dali-PropertyMap.cpp @@ -199,8 +199,7 @@ int UtcDaliPropertyMapFind(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 1 ); - const std::string world("world"); - value = map.Find( world ); + value = map.Find( "world" ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 2 ); @@ -208,41 +207,16 @@ int UtcDaliPropertyMapFind(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 9 ); - value = map.Find( 10, Property::STRING ); + value = map.Find( 10 ); DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( "DALi", value->Get(), TEST_LOCATION ); - value = map.Find( 10, Property::INTEGER ); - DALI_TEST_CHECK( value == NULL ); - value = map.Find( "invalidKey" ); DALI_TEST_CHECK( !value ); END_TEST; } - -int UtcDaliPropertyMapOperatorIndex(void) -{ - Property::Map map; - map[ "hello" ] = 1; - map[ 10 ] = "DALi"; - map[ "world" ] = 2; - map[ 100 ] = 9; - - const Property::Map map2 = map; - const Property::Value& value10 = map2[10]; - DALI_TEST_EQUALS( value10.Get(), "DALi", TEST_LOCATION ); - - const Property::Value& value100 = map2[100]; - DALI_TEST_EQUALS( value100.Get(), 9, TEST_LOCATION ); - - const Property::Value& valueHello = map2["hello"]; - DALI_TEST_EQUALS( valueHello.Get(), 1, TEST_LOCATION ); - - END_TEST; -} - int UtcDaliPropertyMapInsertP(void) { Property::Map map; diff --git a/automated-tests/src/dali/utc-Dali-Stage.cpp b/automated-tests/src/dali/utc-Dali-Stage.cpp index 10496fd..7611ad2 100644 --- a/automated-tests/src/dali/utc-Dali-Stage.cpp +++ b/automated-tests/src/dali/utc-Dali-Stage.cpp @@ -109,13 +109,10 @@ struct TouchedSignalData receivedTouchEvent.points.clear(); receivedTouchEvent.time = 0; - - receivedTouchData.Reset(); } bool functorCalled; TouchEvent receivedTouchEvent; - TouchData receivedTouchData; }; // Functor that sets the data when touched signal is received @@ -132,21 +129,6 @@ struct TouchedFunctor TouchedSignalData& signalData; }; - -// Functor that sets the data when touched signal is received -struct TouchFunctor -{ - TouchFunctor( TouchedSignalData& data ) : signalData( data ) { } - - void operator()( const TouchData& touch ) - { - signalData.functorCalled = true; - signalData.receivedTouchData = touch; - } - - TouchedSignalData& signalData; -}; - // Stores data that is populated in the wheel-event callback and will be read by the TET cases struct WheelEventSignalData { @@ -1099,208 +1081,6 @@ int UtcDaliStageTouchedSignalN(void) END_TEST; } - -int UtcDaliStageTouchSignalP(void) -{ - TestApplication application; - Stage stage = Stage::GetCurrent(); - - TouchedSignalData data; - TouchFunctor functor( data ); - stage.TouchSignal().Connect( &application, functor ); - - // Render and notify. - application.SendNotification(); - application.Render(); - - // Basic test: No actors, single touch (down then up). - { - GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) ); - data.Reset(); - - GenerateTouch( application, PointState::UP, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) ); - data.Reset(); - } - - // Add an actor to the scene. - Actor actor = Actor::New(); - actor.SetSize( 100.0f, 100.0f ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actor.SetParentOrigin( ParentOrigin::TOP_LEFT ); - actor.TouchedSignal().Connect( &DummyTouchCallback ); - stage.Add( actor ); - - // Render and notify. - application.SendNotification(); - application.Render(); - - // Actor on scene, single touch, down in actor, motion, then up outside actor. - { - GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor ); - data.Reset(); - - GenerateTouch( application, PointState::MOTION, Vector2( 150.0f, 10.0f ) ); // Some motion - - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - data.Reset(); - - GenerateTouch( application, PointState::UP, Vector2( 150.0f, 10.0f ) ); // Some motion - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) ); - data.Reset(); - } - - // Multiple touch. Should only receive a touch on first down and last up. - { - Integration::TouchEvent touchEvent; - Integration::Point point; - - // 1st point - point.SetState( PointState::DOWN ); - point.SetScreenPosition( Vector2( 10.0f, 10.0f ) ); - touchEvent.points.push_back( point ); - application.ProcessEvent( touchEvent ); - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION ); - data.Reset(); - - // 2nd point - touchEvent.points[0].SetState( PointState::STATIONARY ); - point.SetDeviceId( 1 ); - point.SetScreenPosition( Vector2( 50.0f, 50.0f ) ); - touchEvent.points.push_back( point ); - application.ProcessEvent( touchEvent ); - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - data.Reset(); - - // Primary point is up - touchEvent.points[0].SetState( PointState::UP ); - touchEvent.points[1].SetState( PointState::STATIONARY ); - application.ProcessEvent( touchEvent ); - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - data.Reset(); - - // Remove 1st point now, 2nd point is now in motion - touchEvent.points.erase( touchEvent.points.begin() ); - touchEvent.points[0].SetState( PointState::MOTION ); - touchEvent.points[0].SetScreenPosition( Vector2( 150.0f, 50.0f ) ); - application.ProcessEvent( touchEvent ); - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - data.Reset(); - - // Final point Up - touchEvent.points[0].SetState( PointState::UP ); - application.ProcessEvent( touchEvent ); - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION ); - data.Reset(); - } - END_TEST; -} - -int UtcDaliStageTouchSignalN(void) -{ - TestApplication application; - Stage stage = Stage::GetCurrent(); - - TouchedSignalData data; - TouchFunctor functor( data ); - stage.TouchSignal().Connect( &application, functor ); - - // Render and notify. - application.SendNotification(); - application.Render(); - - // Confirm functor not called before there has been any touch event. - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - - // No actors, single touch, down, motion then up. - { - GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0)); - data.Reset(); - - // Confirm there is no signal when the touchpoint is only moved. - GenerateTouch( application, PointState::MOTION, Vector2( 1200.0f, 10.0f ) ); // Some motion - - DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION ); - data.Reset(); - - // Confirm a following up event generates a signal. - GenerateTouch( application, PointState::UP, Vector2( 1200.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0)); - data.Reset(); - } - - // Add an actor to the scene. - Actor actor = Actor::New(); - actor.SetSize( 100.0f, 100.0f ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actor.SetParentOrigin( ParentOrigin::TOP_LEFT ); - actor.TouchedSignal().Connect( &DummyTouchCallback ); - stage.Add( actor ); - - // Render and notify. - application.SendNotification(); - application.Render(); - - // Actor on scene. Interrupted before down and interrupted after down. - { - GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) ); - DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED ); - data.Reset(); - - GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor ); - DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::DOWN ); - data.Reset(); - - GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) ); - - DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); - DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u ); - DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) ); - DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED ); - - DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION ); - - // Check that getting info about a non-existent point returns an empty handle - Actor actor = data.receivedTouchData.GetHitActor( 1 ); - DALI_TEST_CHECK( !actor ); - - data.Reset(); - } - - END_TEST; -} - int UtcDaliStageSignalWheelEventP(void) { TestApplication application; @@ -1539,15 +1319,3 @@ int UtcDaliStageGetObjectRegistryN(void) END_TEST; } - -int UtcDaliStageOperatorAssign(void) -{ - TestApplication app; - Stage stage; - DALI_TEST_CHECK( !stage ); - - stage = Stage::GetCurrent(); - DALI_TEST_CHECK( stage ); - - END_TEST; -} diff --git a/automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp index 36e8488..48b6625 100644 --- a/automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp @@ -149,43 +149,6 @@ struct TouchDataFunctor bool returnValue; }; -struct HandleData -{ - bool signalReceived; - TouchData touchData; - - HandleData() - : signalReceived(false) - { - } -}; - -struct TouchDataHandleFunctor -{ - /** - * Constructor. - * @param[in] data Reference to the data to store callback information. - * @param[in] returnValue What the functor should return. - */ - TouchDataHandleFunctor( HandleData& handleData, bool returnValue = true ) - : handleData(handleData), - returnValue( returnValue ) - { - } - - bool operator()( Actor actor, const TouchData& someTouchData ) - { - handleData.signalReceived = true; - TouchData handle(someTouchData); - handleData.touchData = handle; - return returnValue; - } - - HandleData& handleData; - bool returnValue; -}; - - // Functor that removes the actor when called. struct RemoveActorFunctor : public TouchDataFunctor { @@ -289,7 +252,7 @@ Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vecto /////////////////////////////////////////////////////////////////////////////// -int UtcDaliTouchDataNormalProcessing01(void) +int UtcDaliTouchDataNormalProcessing(void) { TestApplication application; @@ -353,40 +316,6 @@ int UtcDaliTouchDataNormalProcessing01(void) } -int UtcDaliTouchDataNormalProcessing02(void) -{ - TestApplication application; - - Actor actor = Actor::New(); - actor.SetSize(100.0f, 100.0f); - actor.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(actor); - - // Render and notify - application.SendNotification(); - application.Render(); - - // Connect to actor's touched signal - HandleData handleData; - TouchDataHandleFunctor functor( handleData ); - actor.TouchSignal().Connect( &application, functor ); - - Vector2 screenCoordinates( 10.0f, 10.0f ); - Vector2 localCoordinates; - actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y ); - - // Emit a down signal - application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, screenCoordinates ) ); - DALI_TEST_EQUALS( true, handleData.signalReceived, TEST_LOCATION ); - DALI_TEST_EQUALS( 1u, handleData.touchData.GetPointCount(), TEST_LOCATION ); - DALI_TEST_EQUALS( PointState::DOWN, handleData.touchData.GetState(0), TEST_LOCATION ); - DALI_TEST_EQUALS( screenCoordinates, handleData.touchData.GetScreenPosition(0), TEST_LOCATION ); - DALI_TEST_EQUALS( localCoordinates, handleData.touchData.GetLocalPosition(0), 0.1f, TEST_LOCATION ); - - END_TEST; -} - - int UtcDaliTouchDataAPINegative(void) { TestApplication application; diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp index 998b8ec..62052ed 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -179,15 +179,12 @@ int UtcDaliTouchNormalProcessing(void) screenCoordinates.x = screenCoordinates.y = 12.0f; actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y ); application.ProcessEvent( GenerateSingleTouch( TouchPoint::Up, screenCoordinates ) ); - - const TouchPoint *point3ptr = &data.touchEvent.GetPoint(0); - TouchPoint point3( point3ptr->deviceId, point3ptr->state, point3ptr->screen.x, point3ptr->screen.y, point3ptr->local.x, point3ptr->local.y ); - + const TouchPoint *point3 = &data.touchEvent.GetPoint(0); DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION ); DALI_TEST_EQUALS( 1u, data.touchEvent.GetPointCount(), TEST_LOCATION ); - DALI_TEST_EQUALS( TouchPoint::Up, point3.state, TEST_LOCATION ); - DALI_TEST_EQUALS( screenCoordinates, point3.screen, TEST_LOCATION ); - DALI_TEST_EQUALS( localCoordinates, point3.local, 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( TouchPoint::Up, point3->state, TEST_LOCATION ); + DALI_TEST_EQUALS( screenCoordinates, point3->screen, TEST_LOCATION ); + DALI_TEST_EQUALS( localCoordinates, point3->local, 0.1f, TEST_LOCATION ); data.Reset(); // Emit a down signal where the actor is not present diff --git a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp index d38de86..de9d773 100644 --- a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp +++ b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp @@ -356,16 +356,6 @@ class MyTestCustomActor2 : public CustomActor { public: - struct Property - { - enum - { - P1=Dali::PROPERTY_REGISTRATION_START_INDEX, - P2 - }; - }; - - MyTestCustomActor2() { } @@ -414,60 +404,6 @@ private: static TypeRegistration customTypeInit( typeid(MyTestCustomActor2), typeid(Dali::CustomActor), CreateCustomInit, true ); -PropertyRegistration P1( customTypeInit, "propertyOne", MyTestCustomActor2::Property::P1, Property::INTEGER, &SetProperty, &GetProperty ); -PropertyRegistration P2( customTypeInit, "propertyTwo", MyTestCustomActor2::Property::P2, Property::STRING, &SetProperty, &GetProperty ); - - -class MyTestCustomActor3 : public CustomActor -{ -public: - MyTestCustomActor3() - { - } - - static MyTestCustomActor3 New() - { - return MyTestCustomActor3(); // takes ownership - } - - virtual ~MyTestCustomActor3() - { - } - - static MyTestCustomActor3 DownCast( BaseHandle handle ) - { - MyTestCustomActor3 result; - - CustomActor custom = Dali::CustomActor::DownCast( handle ); - if ( custom ) - { - CustomActorImpl& customImpl = custom.GetImplementation(); - - Impl::MyTestCustomActor* impl = dynamic_cast(&customImpl); - - if (impl) - { - result = MyTestCustomActor3(customImpl.GetOwner()); - } - } - - return result; - } - -private: - - MyTestCustomActor3(Internal::CustomActor* internal) - : CustomActor(internal) - { - } - - MyTestCustomActor3( Impl::MyTestCustomActor& impl ) - : CustomActor( impl ) - { - } -}; - -static TypeRegistration customTypeBadInit( typeid(MyTestCustomActor3), typeid(Dali::CustomActor), NULL, false ); BaseHandle CreateCustom(void) { @@ -1040,10 +976,7 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void) // Check property count of type-info is 1 Property::IndexContainer indices; typeInfo.GetPropertyIndices( indices ); - - size_t typePropertyCount = typeInfo.GetPropertyCount(); DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( indices.Size(), typePropertyCount, TEST_LOCATION ); // Ensure indices returned from actor and customActor differ by two Actor actor = Actor::New(); @@ -2144,68 +2077,3 @@ int UtcDaliTypeInfoGetSignalNameN(void) END_TEST; } - - -int UtcDaliTypeInfoGetCreatorP(void) -{ - TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); - - TypeInfo::CreateFunction createFn = typeInfo.GetCreator(); - DALI_TEST_EQUALS( createFn != NULL, true, TEST_LOCATION ); - if( createFn ) - { - // try calling it: - BaseHandle handle = createFn(); - DALI_TEST_EQUALS( (bool)handle, true, TEST_LOCATION ); - } - - END_TEST; -} - -int UtcDaliTypeInfoGetCreatorN(void) -{ - TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor3" ); - DALI_TEST_CHECK( typeInfo ); - - TypeInfo::CreateFunction createFn = typeInfo.GetCreator(); - DALI_TEST_EQUALS( createFn == NULL, true, TEST_LOCATION ); - - END_TEST; -} - -int UtcDaliTypeInfoGetPropertyCountP1(void) -{ - TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); - size_t actorPropertyCount = typeInfo.GetPropertyCount(); - - DALI_TEST_EQUALS( actorPropertyCount == 0 , true, TEST_LOCATION ); // No event only props - END_TEST; -} - -int UtcDaliTypeInfoGetPropertyCountP2(void) -{ - TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor2" ); - DALI_TEST_CHECK( typeInfo ); - size_t propertyCount = typeInfo.GetPropertyCount(); - Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); - - DALI_TEST_EQUALS( propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( propertyCount == 2, true, TEST_LOCATION ); - - END_TEST; -} diff --git a/build/tizen/Makefile.am b/build/tizen/Makefile.am index 925f052..c1296f3 100644 --- a/build/tizen/Makefile.am +++ b/build/tizen/Makefile.am @@ -49,8 +49,7 @@ cov_data: @for i in `find $(COVERAGE_DIR) -name "libdali_la-*.gcda" -o -name "libdali_la-*.gcno"` ;\ do mv $$i `echo $$i | sed s/libdali_la-//` ; done @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info - @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "*/dali-env/*" "/usr/include/*" "public-api/shader-effects/*" "*/image-actor*" -o dali.info - + @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "*/dali-env/*" "/usr/include/*" -o dali.info @test -z $(COVERAGE_OUTPUT_DIR) || mkdir -p $(COVERAGE_OUTPUT_DIR) coverage: cov_data -- 2.7.4