X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Visual.cpp;h=263e79e6f541de13d3ed4ec6c3ebac0fc39b1208;hp=4959ed91f84233dfaf6197c85f4f567aa99fb5d7;hb=406208364fe0ee31f31f475ba7ee7709e56d3e27;hpb=b1fd7c9ac268691ba02ca0b358b82a6f76d31edb diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 4959ed9..263e79e 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -662,6 +662,19 @@ int UtcDaliVisualGetPropertyMap5(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == true ); + // Test the properties.. + Property::Value imageValue = imageVisual.GetProperty( ImageVisual::Property::URL ); + DALI_TEST_CHECK( imageValue.Get() == TEST_IMAGE_FILE_NAME ); + + // Other Properties for Image Visual can be tested here once implemented in the Visual + + tet_infoline( "UtcDaliVisualGetPropertyMap5 Ensuring Property without a Getter is not problematic" ); + imageValue = imageVisual.GetProperty( ImageVisual::Property::DESIRED_HEIGHT ); + DALI_TEST_CHECK( imageValue.Get() != 30 ); + + + // Rest of test uses Image not an url ( legacy ) + // Get an image visual with an image handle, and test the default property values Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200)); imageVisual = factory.CreateVisual(image); @@ -707,10 +720,6 @@ int UtcDaliVisualGetPropertyMap5(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == false ); - // Test the properties. TODO: to be completed. - imageVisual.SetProperty( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - Property::Value imageValue = imageVisual.GetProperty( ImageVisual::Property::URL ); - END_TEST; } @@ -719,11 +728,13 @@ int UtcDaliVisualGetPropertyMap6(void) ToolkitTestApplication application; tet_infoline( "UtcDaliVisualGetPropertyMap6: NPatchVisual" ); + bool BORDER_ONLY_SETTING = true; + VisualFactory factory = VisualFactory::Get(); Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); propertyMap.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); - propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true ); + propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, BORDER_ONLY_SETTING ); Visual::Base nPatchVisual = factory.CreateVisual( propertyMap ); Property::Map resultMap; @@ -742,9 +753,19 @@ int UtcDaliVisualGetPropertyMap6(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() ); - // Test the properties. TODO: to be completed. - nPatchVisual.SetProperty( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); + // Test the properties via Index. + nPatchVisual.SetProperty( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); // May not able to change URL in future using SetProperty Property::Value nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::URL ); + DALI_TEST_CHECK( nPatchValue.Get() == TEST_NPATCH_FILE_NAME ); + + nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::BORDER_ONLY ); + DALI_TEST_CHECK( nPatchValue.Get() == BORDER_ONLY_SETTING ); + + // Other Properties for N-Patch Visual can be tested here once implemented in the Visual + + tet_infoline( "UtcDaliVisualGetPropertyMap6 Ensuring Property without a Getter is not problematic" ); + nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::DESIRED_HEIGHT ); + DALI_TEST_CHECK( nPatchValue.Get() != 30 ); END_TEST; } @@ -1060,8 +1081,7 @@ int UtcDaliVisualGetPropertyMap10(void) DALI_TEST_CHECK( !value->Get() ); value = resultMap.Find( TextVisual::Property::ENABLE_AUTO_SCROLL, Property::BOOLEAN ); - DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( !value->Get() ); + DALI_TEST_CHECK( !value ); value = resultMap.Find( TextVisual::Property::LINE_SPACING, Property::FLOAT ); DALI_TEST_CHECK( value );