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 ) );
{
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" ) );
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 );
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;
}
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;
}
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;
}
END_TEST;
}
+
+int UtcDaliImageViewSetImageTypeChangesP(void)
+{
+ ToolkitTestApplication application;
+
+ ImageView imageView = ImageView::New();
+
+
+ std::string url;
+ Property::Map map;
+
+ Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
+
+ // Set a URL
+ imageView.SetImage( "TEST_URL" );
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+
+ DALI_TEST_CHECK( value.Get( url ) ); // Value should NOT be empty
+ DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
+
+ // Set an empty Image
+ imageView.SetImage( Image() );
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
+
+ // Set an Image
+ ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
+ imageView.SetImage( image1 );
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
+
+ // Set an empty URL
+ imageView.SetImage( "" );
+ value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+
+ DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+ DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
+
+ END_TEST;
+}