From: Priya Kohli Date: Fri, 11 Oct 2019 09:30:01 +0000 (+0530) Subject: [ITC][dali-core][ACR-1459][Added Property::Value and Property::Value::Get] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3c98ccf58a9746ee4ea8a61564c83d4bd7b550e;p=test%2Ftct%2Fnative%2Fapi.git [ITC][dali-core][ACR-1459][Added Property::Value and Property::Value::Get] Change-Id: Ia5af087ae90c6f133da71820090bfe941d54c89d Signed-off-by: Priya Kohli --- diff --git a/src/itc/dali-core/property-value/ITs-property-value.cpp b/src/itc/dali-core/property-value/ITs-property-value.cpp index e04ceaee6..47ecd5bc5 100755 --- a/src/itc/dali-core/property-value/ITs-property-value.cpp +++ b/src/itc/dali-core/property-value/ITs-property-value.cpp @@ -50,16 +50,20 @@ void PropertyValueConstructorsExtentsType2(void); void PropertyValueAssignmentOperatorExtents(void); void PropertyValueGetExtents(void); void PropertyValueConstructorsInitializerList(void); +void PropertyValueConstructorsEnum(void); +void PropertyValueGetEnum(void); namespace { enum TEST_CASES_LIST_PROPERTY_VALUE { - PROPERTY_VALUE_CONSTRUCTOR_EXTENTSTYPE, - PROPERTY_VALUE_CONSTRUCTOR_EXTENTSTYPE2, - PROPERTY_VALUE_OPERATORASSIGNMENT_EXTENTS, - PROPERTY_VALUE_GET_EXTENTS, - PROPERTY_VALUE_CONSTRUCTOR_INITIALIZER_LIST + PROPERTY_VALUE_CONSTRUCTOR_EXTENTSTYPE, + PROPERTY_VALUE_CONSTRUCTOR_EXTENTSTYPE2, + PROPERTY_VALUE_OPERATORASSIGNMENT_EXTENTS, + PROPERTY_VALUE_GET_EXTENTS, + PROPERTY_VALUE_CONSTRUCTOR_INITIALIZER_LIST, + PROPERTY_VALUE_CONSTRUCTOR_ENUM, + PROPERTY_VALUE_GET_ENUM }; struct TestApp : public ConnectionTracker @@ -109,6 +113,14 @@ namespace case PROPERTY_VALUE_CONSTRUCTOR_INITIALIZER_LIST: PropertyValueConstructorsInitializerList(); break; + + case PROPERTY_VALUE_CONSTRUCTOR_ENUM: + PropertyValueConstructorsEnum(); + break; + + case PROPERTY_VALUE_GET_ENUM: + PropertyValueGetEnum(); + break; } } // Data @@ -281,8 +293,8 @@ void PropertyValueConstructorsInitializerList(void) * @since_tizen 5.5 * @type Positive * @description Check if the Constructor works for initializer_list or not. -* @scenario ****** -* @apicovered ****** +* @scenario Checks Constructor for initializer_list. +* @apicovered PropertyValue::Get, PropertyValue::GetType * @passcase If propertymap value initializer_list constructor is working Properly * @failcase If Fail to work properly * @precondition NA @@ -298,6 +310,91 @@ int ITcPropertyValueConstructorsInitializerList(void) return test_return_value; } +void PropertyValueConstructorsEnum(void) +{ + enum class T { + V1 = 1, V2 = 2 + }; + + Property::Value value1 = T::V1; + DALI_CHECK_FAIL( value1.GetType() != Property::INTEGER , "PropertyValue Constuctor for Enumeration type has Failed."); + DALI_CHECK_FAIL( T::V1 != value1.Get(), "PropertyValue::Get for Enumeration Type has Failed." ); + + Property::Value value2 = T::V2; + DALI_CHECK_FAIL( value2.GetType() != Property::INTEGER , "PropertyValue Constuctor for Enumeration type has Failed."); + DALI_CHECK_FAIL( T::V2 != value2.Get(), "PropertyValue::Get for Enumeration Type has Failed." ); + + DaliLog::PrintPass(); +} + +//& purpose: To check if the Constructor works for enum or not. +//& type: auto +/** +* @testcase ITcPropertyValueConstructorsEnum +* @since_tizen 5.5 +* @type Positive +* @description Checks if the Constructor works for enum or not. +* @scenario Checks Constructor for enum +* @apicovered PropertyValue::GetType +* @passcase If propertymap value enum constructor is working Properly +* @failcase If target api fail to work properly +* @precondition NA +* @postcondition NA +*/ +int ITcPropertyValueConstructorsEnum(void) +{ + DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__); + Application application = Application::New( &gArgc, &gArgv ); + CHECK_OPEN_GL(SUITE_NAME,__LINE__) + TestApp testApp( application, PROPERTY_VALUE_CONSTRUCTOR_ENUM); + application.MainLoop(); + return test_return_value; +} + +void PropertyValueGetEnum(void) +{ + enum class T { + None, V1 = 1, V2 = 2 + }; + + Property::Value value1 = T::V1; + Property::Value value2 = T::V2; + DALI_CHECK_FAIL( T::V1 != value1.Get(), "PropertyValue::Get for Enumeration Type has Failed." ); + DALI_CHECK_FAIL( T::V2 != value2.Get(), "PropertyValue::Get for Enumeration Type has Failed." ); + + T result = T::None; + DALI_CHECK_FAIL( !value1.Get(result), "PropertyValue::Get for Enumeration Type has Failed." ); + DALI_CHECK_FAIL( result != T::V1, "PropertyValue::Get for Enumeration Type has Failed." ); + DALI_CHECK_FAIL( !value2.Get(result), "PropertyValue::Get for Enumeration Type has Failed." ); + DALI_CHECK_FAIL( result != T::V2, "PropertyValue::Get for Enumeration Type has Failed." ); + + DaliLog::PrintPass(); +} + +//& purpose: To check if Get api is working for enums or not. +//& type: auto +/** +* @testcase ITcPropertyValueGetEnum +* @since_tizen 5.5 +* @type Positive +* @description Checks if Get api is working for enums or not. +* @scenario Use Get api to get the result by PropertyValue::Get +* @apicovered PropertyValue::Get +* @passcase If the Get api works for enums +* @failcase If the Get api do not work for enums +* @precondition NA +* @postcondition NA +*/ +int ITcPropertyValueGetEnum(void) +{ + DaliLog::PrintExecStarted(SUITE_NAME, __FUNCTION__); + Application application = Application::New( &gArgc, &gArgv ); + CHECK_OPEN_GL(SUITE_NAME,__LINE__) + TestApp testApp( application, PROPERTY_VALUE_GET_ENUM); + application.MainLoop(); + return test_return_value; +} + /** @} */ // end of itc-propertyValue-testcases /** @} */ // end of itc-propertyValue /** @} */ // end of itc-dali-core diff --git a/src/itc/dali-core/tct-dali-core-native_mobile.h b/src/itc/dali-core/tct-dali-core-native_mobile.h index 6b9c7a1c9..2fe176dfe 100755 --- a/src/itc/dali-core/tct-dali-core-native_mobile.h +++ b/src/itc/dali-core/tct-dali-core-native_mobile.h @@ -774,6 +774,8 @@ extern int ITcPropertyValueConstructorsExtentsType2(void); extern int ITcPropertyValueAssignmentOperatorExtents(void); extern int ITcPropertyValueGetExtents(void); extern int ITcPropertyValueConstructorsInitializerList(void); +extern int ITcPropertyValueConstructorsEnum(void); +extern int ITcPropertyValueGetEnum(void); extern int ITcQuaternionByFloat(void); extern int ITcQuaternionByVector(void); extern int ITcQuaternionByAngleVector4Axis(void); @@ -1657,6 +1659,8 @@ testcase tc_array[] = { {"ITcPropertyValueAssignmentOperatorExtents",ITcPropertyValueAssignmentOperatorExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueGetExtents", ITcPropertyValueGetExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueConstructorsInitializerList", ITcPropertyValueConstructorsInitializerList,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueConstructorsEnum", ITcPropertyValueConstructorsEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueGetEnum", ITcPropertyValueGetEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcQuaternionByFloat",ITcQuaternionByFloat,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByVector",ITcQuaternionByVector,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByAngleVector4Axis",ITcQuaternionByAngleVector4Axis,ITs_quaternion_startup,ITs_quaternion_cleanup}, diff --git a/src/itc/dali-core/tct-dali-core-native_tizeniot.h b/src/itc/dali-core/tct-dali-core-native_tizeniot.h index e8e0678f9..9ab651e22 100755 --- a/src/itc/dali-core/tct-dali-core-native_tizeniot.h +++ b/src/itc/dali-core/tct-dali-core-native_tizeniot.h @@ -773,6 +773,8 @@ extern int ITcPropertyValueConstructorsExtentsType2(void); extern int ITcPropertyValueAssignmentOperatorExtents(void); extern int ITcPropertyValueGetExtents(void); extern int ITcPropertyValueConstructorsInitializerList(void); +extern int ITcPropertyValueConstructorsEnum(void); +extern int ITcPropertyValueGetEnum(void); extern int ITcQuaternionByFloat(void); extern int ITcQuaternionByVector(void); extern int ITcQuaternionByAngleVector4Axis(void); @@ -1653,6 +1655,8 @@ testcase tc_array[] = { {"ITcPropertyValueAssignmentOperatorExtents",ITcPropertyValueAssignmentOperatorExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueGetExtents", ITcPropertyValueGetExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueConstructorsInitializerList", ITcPropertyValueConstructorsInitializerList,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueConstructorsEnum", ITcPropertyValueConstructorsEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueGetEnum", ITcPropertyValueGetEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcQuaternionByFloat",ITcQuaternionByFloat,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByVector",ITcQuaternionByVector,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByAngleVector4Axis",ITcQuaternionByAngleVector4Axis,ITs_quaternion_startup,ITs_quaternion_cleanup}, diff --git a/src/itc/dali-core/tct-dali-core-native_wearable.h b/src/itc/dali-core/tct-dali-core-native_wearable.h index 59532dda3..a451e4be8 100755 --- a/src/itc/dali-core/tct-dali-core-native_wearable.h +++ b/src/itc/dali-core/tct-dali-core-native_wearable.h @@ -773,6 +773,8 @@ extern int ITcPropertyValueConstructorsExtentsType2(void); extern int ITcPropertyValueAssignmentOperatorExtents(void); extern int ITcPropertyValueGetExtents(void); extern int ITcPropertyValueConstructorsInitializerList(void); +extern int ITcPropertyValueConstructorsEnum(void); +extern int ITcPropertyValueGetEnum(void); extern int ITcQuaternionByFloat(void); extern int ITcQuaternionByVector(void); extern int ITcQuaternionByAngleVector4Axis(void); @@ -1656,6 +1658,8 @@ testcase tc_array[] = { {"ITcPropertyValueAssignmentOperatorExtents",ITcPropertyValueAssignmentOperatorExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueGetExtents", ITcPropertyValueGetExtents,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcPropertyValueConstructorsInitializerList", ITcPropertyValueConstructorsInitializerList,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueConstructorsEnum", ITcPropertyValueConstructorsEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, + {"ITcPropertyValueGetEnum", ITcPropertyValueGetEnum,ITs_propertyValue_startup,ITs_propertyValue_cleanup}, {"ITcQuaternionByFloat",ITcQuaternionByFloat,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByVector",ITcQuaternionByVector,ITs_quaternion_startup,ITs_quaternion_cleanup}, {"ITcQuaternionByAngleVector4Axis",ITcQuaternionByAngleVector4Axis,ITs_quaternion_startup,ITs_quaternion_cleanup},