END_TEST;
}
+//Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location, but duff optional parameters
+int UtcDaliVisualFactoryGetMeshVisual3b(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct" );
+
+ //Set up visual properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::TYPE, Visual::MESH );
+ propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
+ propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
+ propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, Color::GREEN ); // Test that wrong property types don't prevent the object load
+ propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, 1.0f );
+ propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, 1.0f );
+ propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+
+ //Test to see if mesh loads correctly.
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
+
+ END_TEST;
+}
+
//Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location.
int UtcDaliVisualFactoryGetMeshVisual3(void)
{
propertyMap.Insert( Visual::Property::TYPE, Visual::MESH );
propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
+ propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, false );
+ propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, false );
+ propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3::XAXIS );
propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
//Test to see if mesh loads correctly.
//Test to see if mesh loads correctly.
MeshVisualLoadsCorrectlyTest( propertyMap, application );
-
END_TEST;
}
//Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
- propertyMap.Insert( MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING );
+ propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
+ propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
+ propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert( "useMipmapping", false );
+ propertyMap.Insert( "useSoftNormals", false );
+ propertyMap.Insert( "lightPosition", Vector3::ZAXIS );
+ propertyMap.Insert( "shadingMode", MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING );
//Test to see if mesh loads correctly.
MeshVisualLoadsCorrectlyTest( propertyMap, application );
// Create a property-map that enables batching.
Property::Map propertyMap;
- propertyMap.Insert( Dali::Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true );
+ propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ;
+ propertyMap[ "desiredHeight" ] = 200;
+ propertyMap[ "desiredWidth" ] = 200;
+ propertyMap[ "batchingEnabled" ] = true;
+
+ // Create an ImageView, passing the property-map in to instruct it to use batching.
+ Toolkit::ImageView imageView = Toolkit::ImageView::New();
+ imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap );
+
+ imageView.SetSize( 200.0f, 200.0f );
+ Stage::GetCurrent().Add( imageView );
+
+ END_TEST;
+}
+
+int UtcDaliVisualFactoryGetBatchImageVisual4N(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual4: Create an ImageView that uses a batched visual, with desired properties of the wrong type" );
+
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ // Create a property-map that enables batching.
+ Property::Map propertyMap;
+ propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ;
+ propertyMap[ "desiredHeight" ] = Vector2(100, 100);
+ propertyMap[ "desiredWidth" ] = Vector3(1, 1, 1);
+ propertyMap[ "batchingEnabled" ] = true;
// Create an ImageView, passing the property-map in to instruct it to use batching.
Toolkit::ImageView imageView = Toolkit::ImageView::New();