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=577213d1ea25d3949d2fde66c5061bf5104c0645;hp=b061cf1bc059cbec6059180b6fef61e1e1ed3acc;hb=d6fead18ff8cc7fca3feb1aa1789e47583796814;hpb=1894ecb2c5bdcb91549d9da9d8301d0a753c5492 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index b061cf1..577213d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -308,6 +308,10 @@ int UtcDaliVisualGetPropertyMap1(void) DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == Color::CYAN ); + // Test the properties. TODO: to be completed. + colorVisual.SetProperty( ColorVisual::Property::MIX_COLOR, Color::RED ); + Property::Value value = colorVisual.GetProperty( ColorVisual::Property::MIX_COLOR ); + END_TEST; } @@ -358,6 +362,10 @@ int UtcDaliVisualGetPropertyMap2(void) DALI_TEST_CHECK( colorValue ); DALI_TEST_CHECK( colorValue->Get() == 10.f ); + // Test the properties. TODO: to be completed. + borderVisual.SetProperty( BorderVisual::Property::COLOR, Color::RED ); + Property::Value value = borderVisual.GetProperty( BorderVisual::Property::COLOR ); + END_TEST; } @@ -425,6 +433,10 @@ int UtcDaliVisualGetPropertyMap3(void) DALI_TEST_EQUALS( colorArray->GetElementAt(0).Get(), Color::RED , Math::MACHINE_EPSILON_100, TEST_LOCATION ); DALI_TEST_EQUALS( colorArray->GetElementAt(1).Get(), Color::GREEN , Math::MACHINE_EPSILON_100, TEST_LOCATION ); + // Test the properties. TODO: to be completed. + gradientVisual.SetProperty( GradientVisual::Property::STOP_COLOR, Color::RED ); + Property::Value gradientValue = gradientVisual.GetProperty( GradientVisual::Property::STOP_COLOR ); + END_TEST; } @@ -609,6 +621,10 @@ 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; } @@ -640,6 +656,10 @@ 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 ); + Property::Value nPatchValue = nPatchVisual.GetProperty( ImageVisual::Property::URL ); + END_TEST; } @@ -652,7 +672,7 @@ int UtcDaliVisualGetPropertyMap7(void) VisualFactory factory = VisualFactory::Get(); Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ); + propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ); Visual::Base svgVisual = factory.CreateVisual( propertyMap ); Property::Map resultMap; @@ -679,6 +699,10 @@ int UtcDaliVisualGetPropertyMap7(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == TEST_SVG_FILE_NAME ); + // Test the properties. TODO: to be completed. + svgVisual.SetProperty( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ); + Property::Value svgValue = svgVisual.GetProperty( ImageVisual::Property::URL ); + END_TEST; } @@ -727,6 +751,10 @@ int UtcDaliVisualGetPropertyMap8(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), Vector3( 5.0f, 10.0f, 15.0f), Math::MACHINE_EPSILON_100, TEST_LOCATION ); + // Test the properties. TODO: to be completed. + meshVisual.SetProperty( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME ); + Property::Value meshValue = meshVisual.GetProperty( MeshVisual::Property::OBJECT_URL ); + END_TEST; } @@ -744,7 +772,7 @@ int UtcDaliVisualGetPropertyMap9(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, color ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, color ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); @@ -769,7 +797,7 @@ int UtcDaliVisualGetPropertyMap9(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), (int)PrimitiveVisual::Shape::CUBE, TEST_LOCATION ); - value = resultMap.Find( PrimitiveVisual::Property::COLOR, Property::VECTOR4 ); + value = resultMap.Find( PrimitiveVisual::Property::MIX_COLOR, Property::VECTOR4 ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == color ); DALI_TEST_EQUALS( value->Get(), color, Math::MACHINE_EPSILON_100, TEST_LOCATION ); @@ -814,6 +842,10 @@ int UtcDaliVisualGetPropertyMap9(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), Vector3( 5.0f, 10.0f, 15.0f), Math::MACHINE_EPSILON_100, TEST_LOCATION ); + // Test the properties. TODO: to be completed. + primitiveVisual.SetProperty( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); + Property::Value primitiveValue = primitiveVisual.GetProperty( PrimitiveVisual::Property::SHAPE ); + END_TEST; } @@ -853,6 +885,10 @@ int UtcDaliVisualGetPropertyMapBatchImageVisual(void) DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == 30 ); + // Test the properties. TODO: to be completed. + batchImageVisual.SetProperty( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); + Property::Value primitiveValue = batchImageVisual.GetProperty( ImageVisual::Property::URL ); + END_TEST; } @@ -1043,7 +1079,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::COLOR ); + Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR ); // The property isn't registered on the renderer, it's instead registered on the shader. DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION ); @@ -1088,5 +1124,9 @@ int UtcDaliVisualWireframeVisual(void) Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == Visual::WIREFRAME ); + + // Test the properties. TODO: to be completed. + Property::Value primitiveValue = visual.GetProperty( Visual::Property::TYPE ); + END_TEST; }