From: Adeel Kazmi Date: Mon, 23 Nov 2015 10:06:46 +0000 (+0000) Subject: (AutomatedTests) Ensure warnings are shown as errors X-Git-Tag: dali_1.1.12~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=75fdb5f9730fa6f6723c517691c9778fb646d082;hp=a15b41d8a287aac7174a6df3cee708cfa0c2aeba;ds=sidebyside (AutomatedTests) Ensure warnings are shown as errors Change-Id: Ib85ad8c51010017f8911d9295df0d2f8240ef81f --- diff --git a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt index a3a263f..9ebbcf4 100644 --- a/automated-tests/src/dali-toolkit-internal/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit-internal/CMakeLists.txt @@ -44,7 +44,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED dali-toolkit ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror=return-type") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror") FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS}) SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}") diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp index 410c34f..8ad3b15 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp @@ -171,8 +171,10 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns01; ScriptRun scriptRun0100 = { - 0u, - 11u, + { + 0u, + 11u, + }, TextAbstraction::LATIN }; scriptRuns01.PushBack( scriptRun0100 ); @@ -181,14 +183,18 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns02; ScriptRun scriptRun0200 = { - 0u, - 12u, + { + 0u, + 12u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun0201 = { - 12u, - 13u, + { + 12u, + 13u, + }, TextAbstraction::ARABIC }; scriptRuns02.PushBack( scriptRun0200 ); @@ -198,14 +204,18 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns03; ScriptRun scriptRun0300 = { - 0u, - 14u, + { + 0u, + 14u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun0301 = { - 14u, - 11u, + { + 14u, + 11u, + }, TextAbstraction::LATIN }; scriptRuns03.PushBack( scriptRun0300 ); @@ -215,8 +225,10 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns04; ScriptRun scriptRun0400 = { - 0u, - 16u, + { + 0u, + 16u, + }, TextAbstraction::LATIN }; scriptRuns04.PushBack( scriptRun0400 ); @@ -225,8 +237,10 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns05; ScriptRun scriptRun0500 = { - 0u, - 16u, + { + 0u, + 16u, + }, TextAbstraction::LATIN }; scriptRuns05.PushBack( scriptRun0500 ); @@ -235,8 +249,10 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns06; ScriptRun scriptRun0600 = { - 0u, - 16u, + { + 0u, + 16u, + }, TextAbstraction::LATIN }; scriptRuns06.PushBack( scriptRun0600 ); @@ -245,14 +261,18 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns07; ScriptRun scriptRun0700 = { - 0u, - 8u, + { + 0u, + 8u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun0701 = { - 8u, - 5u, + { + 8u, + 5u, + }, TextAbstraction::HANGUL }; scriptRuns07.PushBack( scriptRun0700 ); @@ -262,20 +282,26 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns08; ScriptRun scriptRun0800 = { - 0u, - 18u, + { + 0u, + 18u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun0801 = { - 18u, - 14u, + { + 18u, + 14u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun0802 = { - 32u, - 18u, + { + 32u, + 18u, + }, TextAbstraction::HANGUL }; scriptRuns08.PushBack( scriptRun0800 ); @@ -286,26 +312,34 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns09; ScriptRun scriptRun0900 = { - 0u, - 21u, + { + 0u, + 21u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun0901 = { - 21u, - 16u, + { + 21u, + 16u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun0902 = { - 37u, - 10u, + { + 37u, + 10u, + }, TextAbstraction::HANGUL }; ScriptRun scriptRun0903 = { - 47u, - 20u, + { + 47u, + 20u, + }, TextAbstraction::ARABIC }; scriptRuns09.PushBack( scriptRun0900 ); @@ -317,68 +351,90 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns10; ScriptRun scriptRun1000 = { - 0u, - 20u, + { + 0u, + 20u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun1001 = { - 20u, - 12u, + { + 20u, + 12u, + }, TextAbstraction::HEBREW }; ScriptRun scriptRun1002 = { - 32u, - 17u, + { + 32u, + 17u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun1003 = { - 49u, - 18u, + { + 49u, + 18u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun1004 = { - 67u, - 14u, + { + 67u, + 14u, + }, TextAbstraction::HANGUL }; ScriptRun scriptRun1005 = { - 81u, - 19u, + { + 81u, + 19u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun1006 = { - 100u, - 13u, + { + 100u, + 13u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun1007 = { - 113u, - 16u, + { + 113u, + 16u, + }, TextAbstraction::HEBREW }; ScriptRun scriptRun1008 = { - 129u, - 20u, + { + 129u, + 20u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun1009 = { - 149u, - 14u, + { + 149u, + 14u, + }, TextAbstraction::ARABIC }; ScriptRun scriptRun1010 = { - 163u, - 35u, + { + 163u, + 35u, + }, TextAbstraction::HANGUL }; scriptRuns10.PushBack( scriptRun1000 ); @@ -397,14 +453,18 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns11; ScriptRun scriptRun1100 = { - 0u, - 31u, + { + 0u, + 31u, + }, TextAbstraction::LATIN }; ScriptRun scriptRun1101 = { - 31u, - 21u, + { + 31u, + 21u, + }, TextAbstraction::HEBREW }; scriptRuns11.PushBack( scriptRun1100 ); @@ -414,8 +474,10 @@ int UtcDaliTextMultiLanguageSetScripts(void) Vector scriptRuns12; ScriptRun scriptRun1200 = { - 0u, - 11u, + { + 0u, + 11u, + }, TextAbstraction::LATIN }; scriptRuns12.PushBack( scriptRun1200 ); diff --git a/automated-tests/src/dali-toolkit/CMakeLists.txt b/automated-tests/src/dali-toolkit/CMakeLists.txt index 3b7b51a..5951546 100644 --- a/automated-tests/src/dali-toolkit/CMakeLists.txt +++ b/automated-tests/src/dali-toolkit/CMakeLists.txt @@ -87,7 +87,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED dali-toolkit ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror=return-type") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb --coverage -Wall -Werror") ADD_DEFINITIONS(-DTEST_RESOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/../../resources\" ) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp index 9441e0a..0a90c8e 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp @@ -14,6 +14,7 @@ * limitations under the License. * */ + // CLASS HEADER #include "dali-test-suite-utils.h" @@ -53,28 +54,12 @@ void tet_printf(const char *format, ...) va_end(arg); } -/** - * DALI_TEST_CHECK is a wrapper for tet_result. - * If the condition evaluates to false, then the function & line number is printed. - * @param[in] The boolean expression to check - */ -#define DALI_TEST_CHECK(condition) \ -if ( (condition) ) \ -{ \ - tet_result(TET_PASS); \ -} \ -else \ -{ \ - fprintf(stderr, "%s Failed in %s at line %d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); \ - tet_result(TET_FAIL); \ -} - bool operator==(TimePeriod a, TimePeriod b) { return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds) ; } -std::ostream& operator<< (std::ostream& ostream, const TimePeriod value) +std::ostream& operator<<( std::ostream& ostream, TimePeriod value ) { return ostream << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")"; } @@ -91,6 +76,21 @@ std::ostream& operator<<( std::ostream& ostream, Degree angle ) return ostream; } +void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location ) +{ + DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location ); +} + +void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location ) +{ + DALI_TEST_EQUALS< unsigned int>( ( unsigned int )( value1 ), value2, location ); +} + +void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location ) +{ + DALI_TEST_EQUALS< unsigned int >( value1, ( unsigned int )( value2 ), location ); +} + void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location) { const float* m1 = matrix1.AsFloat(); @@ -99,10 +99,13 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha for (int i=0;i<9;++i) { - equivalent &= (m1[i] != m2[i]); + if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) ) + { + equivalent = false; + } } - if (!equivalent) + if( !equivalent ) { fprintf(stderr, "%s, checking\n" "(%f, %f, %f) (%f, %f, %f)\n" @@ -241,47 +244,6 @@ void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* lo DALI_TEST_EQUALS(str1, str2.c_str(), location); } - -/** - * Test whether one unsigned integer value is greater than another. - * Test succeeds if value1 > value2 - * @param[in] value1 The first value - * @param[in] value2 The second value - * @param[in] location The TEST_LOCATION macro should be used here - */ -void DALI_TEST_GREATER(unsigned int value1, unsigned int value2, const char* location) -{ - if (!(value1 > value2)) - { - fprintf(stderr, "%s, checking %d > %d\n", location, value1, value2); - tet_result(TET_FAIL); - } - else - { - tet_result(TET_PASS); - } -} - -/** - * Test whether one float value is greater than another. - * Test succeeds if value1 > value2 - * @param[in] value1 The first value - * @param[in] value2 The second value - * @param[in] location The TEST_LOCATION macro should be used here - */ -void DALI_TEST_GREATER( float value1, float value2, const char* location) -{ - if (!(value1 > value2)) - { - fprintf(stderr, "%s, checking %f > %f\n", location, value1, value2); - tet_result(TET_FAIL); - } - else - { - tet_result(TET_PASS); - } -} - void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location ) { if( NULL == strstr( e.condition, conditionSubString.c_str() ) ) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h index 30ace77..c521fbf 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h @@ -20,11 +20,10 @@ // EXTERNAL INCLUDES #include -#include +#include // INTERNAL INCLUDES #include -#include void tet_infoline(const char*str); void tet_printf(const char *format, ...); @@ -58,7 +57,7 @@ void tet_printf(const char *format, ...); /** * DALI_TEST_CHECK is a wrapper for tet_result. - * If the condition evaluates to false, then the function & line number is printed. + * If the condition evaluates to false, the test is stopped. * @param[in] The boolean expression to check */ #define DALI_TEST_CHECK(condition) \ @@ -70,6 +69,7 @@ else { \ fprintf(stderr, "%s Failed in %s at line %d\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); \ tet_result(TET_FAIL); \ + throw("TET_FAIL"); \ } template @@ -163,8 +163,8 @@ std::ostream& operator<<( std::ostream& ostream, Degree angle ); * @param[in] value2 The second value * @param[in] location The TEST_LOCATION macro should be used here */ -template -inline void DALI_TEST_EQUALS(TypeA value1, TypeB value2, const char* location) +template +inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location) { if (!(value1 == value2)) { @@ -222,6 +222,30 @@ inline void DALI_TEST_EQUALS( TimePeriod value1, TimePeriod value2, } /** + * Test whether two base handles are equal. + * @param[in] baseHandle1 The first value + * @param[in] baseHandle2 The second value + * @param[in] location The TEST_LOCATION macro should be used here + */ +void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location ); + +/** + * Test whether a size_t value and an unsigned int are equal. + * @param[in] value1 The first value + * @param[in] value2 The second value + * @param[in] location The TEST_LOCATION macro should be used here + */ +void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location ); + +/** + * Test whether an unsigned int and a size_t value and are equal. + * @param[in] value1 The first value + * @param[in] value2 The second value + * @param[in] location The TEST_LOCATION macro should be used here + */ +void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location ); + +/** * Test whether two Matrix3 objects are equal. * @param[in] matrix1 The first object * @param[in] matrix2 The second object @@ -308,16 +332,19 @@ void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* lo * @param[in] value2 The second value * @param[in] location The TEST_LOCATION macro should be used here */ -void DALI_TEST_GREATER(unsigned int value1, unsigned int value2, const char* location); - -/** - * Test whether one float value is greater than another. - * Test succeeds if value1 > value2 - * @param[in] value1 The first value - * @param[in] value2 The second value - * @param[in] location The TEST_LOCATION macro should be used here - */ -void DALI_TEST_GREATER( float value1, float value2, const char* location); +template< typename T > +void DALI_TEST_GREATER( T value1, T value2, const char* location) +{ + if (!(value1 > value2)) + { + std::cerr << location << ", checking " << value1 <<" > " << value2 << "\n"; + tet_result(TET_FAIL); + } + else + { + tet_result(TET_PASS); + } +} /** * Test whether the assertion condition that failed and thus triggered the @@ -366,9 +393,8 @@ struct DefaultFunctionCoverage }; -// Helper to Create bitmap image +// Helper to Create buffer image BufferImage CreateBufferImage(); BufferImage CreateBufferImage(int width, int height, const Vector4& color); - #endif // __DALI_TEST_SUITE_UTILS_H__ diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h index c17eb2f..dea1c90 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h @@ -409,7 +409,7 @@ public: { std::stringstream out; out << cap; - mCullFaceTrace.PushCall("Disable", out.str()); + mEnableDisableTrace.PushCall("Disable", out.str()); } inline void DisableVertexAttribArray(GLuint index) @@ -435,7 +435,7 @@ public: { std::stringstream out; out << cap; - mCullFaceTrace.PushCall("Enable", out.str()); + mEnableDisableTrace.PushCall("Enable", out.str()); } inline void EnableVertexAttribArray(GLuint index) @@ -1583,6 +1583,11 @@ public: // TEST FUNCTIONS inline void ResetCullFaceCallStack() { mCullFaceTrace.Reset(); } inline TraceCallStack& GetCullFaceTrace() { return mCullFaceTrace; } + //Methods for Enable/Disable call verification + inline void EnableEnableDisableCallTrace(bool enable) { mEnableDisableTrace.Enable(enable); } + inline void ResetEnableDisableCallStack() { mEnableDisableTrace.Reset(); } + inline TraceCallStack& GetEnableDisableTrace() { return mEnableDisableTrace; } + //Methods for Shader verification inline void EnableShaderCallTrace(bool enable) { mShaderTrace.Enable(enable); } inline void ResetShaderCallStack() { mShaderTrace.Reset(); } @@ -1705,8 +1710,6 @@ public: // TEST FUNCTIONS return false; } - - inline GLuint GetLastShaderCompiled() const { return mLastShaderCompiled; @@ -1815,6 +1818,7 @@ private: ActiveTextureType mActiveTextures[ MIN_TEXTURE_UNIT_LIMIT ]; TraceCallStack mCullFaceTrace; + TraceCallStack mEnableDisableTrace; TraceCallStack mShaderTrace; TraceCallStack mTextureTrace; TraceCallStack mTexParamaterTrace; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp index b15dfbc..d143d35 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp @@ -29,7 +29,7 @@ TestNativeImagePointer TestNativeImage::New(int width, int height) } TestNativeImage::TestNativeImage(int width, int height) -: mWidth(width), mHeight(height) +: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0) { } diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h index b4876cc..4a39cb1 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h @@ -19,25 +19,25 @@ */ // INTERNAL INCLUDES -#include +#include namespace Dali { class TestNativeImage; typedef IntrusivePtr TestNativeImagePointer; -class DALI_IMPORT_API TestNativeImage : public Dali::NativeImage +class DALI_IMPORT_API TestNativeImage : public Dali::NativeImageInterface { public: static TestNativeImagePointer New(int width, int height); - inline virtual bool GlExtensionCreate() {return true;}; - inline virtual void GlExtensionDestroy() {}; - inline virtual GLenum TargetTexture() {return 1;}; + inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return true;}; + 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 Pixel::Format GetPixelFormat() const {return Pixel::RGBA8888;}; + inline virtual bool RequiresBlending() const {return true;}; private: TestNativeImage(int width, int height); @@ -45,6 +45,10 @@ private: int mWidth; int mHeight; +public: + int mExtensionCreateCalls; + int mExtensionDestroyCalls; + int mTargetTextureCalls; }; } // Dali diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h index 68d50f2..ebae313 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-touch-utils.h @@ -40,7 +40,7 @@ struct TouchEventData receivedTouch.points.clear(); receivedTouch.time = 0; - touchActor = NULL; + touchActor.Reset(); } bool functorCalled; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp index e8ee062..f77cdde 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace Dali { @@ -43,7 +44,7 @@ EventThreadCallback::EventThreadCallback( CallbackBase* callback ) { mImpl->callback = callback; mImpl->triggeredCount = 0u; - mImpl->expectedCount = INFINITY; + mImpl->expectedCount = UINT_MAX; sem_init( &(mImpl->mySemaphore), 0, 0 ); gEventThreadCallback = this; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp index a4887ba..bffde5d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp @@ -39,9 +39,14 @@ void utc_dali_toolkit_alignment_cleanup(void) test_return_value = TET_PASS; } - namespace { +/// Compare an int (Or'd Alignment::Type) with an Alignment::Type value +void DALI_TEST_EQUALS( int value1, Alignment::Type value2, const char* location ) +{ + ::DALI_TEST_EQUALS< Alignment::Type >( static_cast< Alignment::Type >( value1 ), value2, location ); +} + static bool gObjectCreatedCallBackCalled; static void TestCallback(BaseHandle handle) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp index a74af90..fbcbcee 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp @@ -92,11 +92,11 @@ int UtcDaliControlRendererSetGetDepthIndex(void) Stage::GetCurrent().Add( actor ); controlRenderer.SetOnStage( actor ); - DALI_TEST_EQUALS( actor.GetRendererAt(0u).GetDepthIndex(), 1.f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetRendererAt(0u).GetDepthIndex(), 1, TEST_LOCATION ); DALI_TEST_EQUALS( controlRenderer.GetDepthIndex(), 1.f, TEST_LOCATION ); controlRenderer.SetDepthIndex( -1.f ); - DALI_TEST_EQUALS( actor.GetRendererAt(0u).GetDepthIndex(), -1.f, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetRendererAt(0u).GetDepthIndex(), -1, TEST_LOCATION ); DALI_TEST_EQUALS( controlRenderer.GetDepthIndex(), -1.f, TEST_LOCATION ); END_TEST; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp index 3883553..0f56e92 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp @@ -153,8 +153,8 @@ int UtcDaliImageAtlasSetBrokenImage(void) atlas.Upload( textureRect, gImageNonExist ); Rect pixelArea = TextureCoordinateToPixelArea(textureRect, size); - DALI_TEST_EQUALS( pixelArea.width, 34.f, TEST_LOCATION ); - DALI_TEST_EQUALS( pixelArea.height, 34.f, TEST_LOCATION ); + DALI_TEST_EQUALS( pixelArea.width, 34, TEST_LOCATION ); + DALI_TEST_EQUALS( pixelArea.height, 34, TEST_LOCATION ); END_TEST; } @@ -231,8 +231,8 @@ int UtcDaliImageAtlasRemove(void) // one pixel gap Rect pixelArea = TextureCoordinateToPixelArea(textureRect2, size); - DALI_TEST_EQUALS( pixelArea.x, 0.f, TEST_LOCATION ); - DALI_TEST_EQUALS( pixelArea.y, 0.f, TEST_LOCATION ); + DALI_TEST_EQUALS( pixelArea.x, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( pixelArea.y, 0, TEST_LOCATION ); END_TEST; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index f817d08..cfe23c3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -53,11 +53,11 @@ void TestImage( ImageView imageView, BufferImage image ) int width = 0; DALI_TEST_CHECK( map[ "width" ].Get( width ) ); - DALI_TEST_EQUALS( width, image.GetWidth(), TEST_LOCATION ); + DALI_TEST_EQUALS( (unsigned int)width, image.GetWidth(), TEST_LOCATION ); int height = 0; DALI_TEST_CHECK( map[ "height" ].Get( height ) ); - DALI_TEST_EQUALS( height, image.GetHeight(), TEST_LOCATION ); + DALI_TEST_EQUALS( (unsigned int)height, image.GetHeight(), TEST_LOCATION ); std::string type; DALI_TEST_CHECK( map[ "type" ].Get( type ) ); @@ -75,14 +75,14 @@ void TestImage( ImageView imageView, ResourceImage image ) { int width = 0; DALI_TEST_CHECK( map[ "width" ].Get( width ) ); - DALI_TEST_EQUALS( width, image.GetWidth(), TEST_LOCATION ); + DALI_TEST_EQUALS( (unsigned int)width, image.GetWidth(), TEST_LOCATION ); } if( map.Find( "height" ) ) { int height = 0; DALI_TEST_CHECK( map[ "height" ].Get( height ) ); - DALI_TEST_EQUALS( height, image.GetHeight(), TEST_LOCATION ); + DALI_TEST_EQUALS( (unsigned int)height, image.GetHeight(), TEST_LOCATION ); } DALI_TEST_CHECK( map.Find( "type" ) ); @@ -238,7 +238,7 @@ int UtcDaliImageViewSetGetProperty01(void) ImageView imageView = ImageView::New(); Property::Index idx = imageView.GetPropertyIndex( "image" ); - DALI_TEST_EQUALS( idx, ImageView::Property::IMAGE, TEST_LOCATION ); + DALI_TEST_EQUALS( idx, (Property::Index)ImageView::Property::IMAGE, TEST_LOCATION ); imageView.SetProperty( idx, TEST_IMAGE_FILE_NAME ); TestUrl( imageView, TEST_IMAGE_FILE_NAME ); @@ -260,8 +260,8 @@ int UtcDaliImageViewSizeWithBackground(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( imageView.GetCurrentSize().width, width, TEST_LOCATION ); - DALI_TEST_EQUALS( imageView.GetCurrentSize().height, height, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetCurrentSize().width, (float)width, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetCurrentSize().height, (float)height, TEST_LOCATION ); END_TEST; } @@ -285,8 +285,8 @@ int UtcDaliImageViewSizeWithBackgroundAndImage(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( imageView.GetCurrentSize().width, width, TEST_LOCATION ); - DALI_TEST_EQUALS( imageView.GetCurrentSize().height, height, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetCurrentSize().width, (float)width, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetCurrentSize().height, (float)height, TEST_LOCATION ); END_TEST; } @@ -333,8 +333,8 @@ int UtcDaliImageViewHeightForWidthBackgroundAndImage(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( imageView.GetHeightForWidth( width ), height, TEST_LOCATION ); - DALI_TEST_EQUALS( imageView.GetWidthForHeight( height ), width, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetHeightForWidth( width ), (float)height, TEST_LOCATION ); + DALI_TEST_EQUALS( imageView.GetWidthForHeight( height ), (float)width, TEST_LOCATION ); END_TEST; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp index 42b7939..24cccdc 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp @@ -518,7 +518,7 @@ int UtcDaliPageTurnPortraitViewSignals(void) Wait(application, 1000); DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified ); // the page is turned over - DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), pageIndex+1, TEST_LOCATION ); + DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), (int)(pageIndex+1), TEST_LOCATION ); //---Test 2: pan from position( size*0.5f ) to position( size.width, size.height*0.5f ) to position( size * 0.75f ), page 1 will bent then slid back--- callbackTurnStarted.Reset(); @@ -547,7 +547,7 @@ int UtcDaliPageTurnPortraitViewSignals(void) Wait(application, 1000); DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified ); - DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), pageIndex, TEST_LOCATION ); // the page is not turned over + DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), (int)pageIndex, TEST_LOCATION ); // the page is not turned over // ----Test 3: pan 10 frames from position( size*0.25f ) to position( size.width*0.75f, size.height*0.25f ), the previous page will be turned backwards--- callbackTurnStarted.Reset(); @@ -656,7 +656,7 @@ int UtcDaliPageTurnLanscapeViewSignals(void) Wait(application, 1000); DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified ); // the page is turned over - DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), pageIndex+1, TEST_LOCATION ); + DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get(), (int)(pageIndex+1), TEST_LOCATION ); //---Test 2: pan from position(stageSize.x * 0.15f, stageSize.y*0.5) to position(stageSize.x * 0.45f, stageSize.y*0.5) page 4 will be turned back--- callbackTurnStarted.Reset(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index f9fd513..4df55da 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -1057,9 +1057,9 @@ int UtcDaliPopupPropertyCustomAnimation(void) Property::Map resultMap; DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::ENTRY_ANIMATION ).Get( resultMap ) ); - DALI_TEST_EQUALS( resultMap.Count(), 0, TEST_LOCATION ); + DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION ); DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::EXIT_ANIMATION ).Get( resultMap ) ); - DALI_TEST_EQUALS( resultMap.Count(), 0, TEST_LOCATION ); + DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( popup ); popup.SetDisplayState( Popup::SHOWN ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index becc47e..b6f5c71 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -296,7 +296,7 @@ int UtcDaliTextFieldSetPropertyP(void) // Check the render backend property. field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS ); - DALI_TEST_EQUALS( field.GetProperty( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); + DALI_TEST_EQUALS( (Text::RenderingType)field.GetProperty( TextField::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); // Check text property. field.SetProperty( TextField::Property::TEXT, "Setting Text" ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 2df3ed0..370fde0 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -163,7 +163,7 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) // Note - we can't check the defaults since the stylesheets are platform-specific label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS ); - DALI_TEST_EQUALS( label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); + DALI_TEST_EQUALS( (Text::RenderingType)label.GetProperty( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION ); // Check that text can be correctly reset label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );