Esempio n. 1
0
int UtcDaliScriptingNewActorNegative(void)
{
  TestApplication application;

  // Empty map
  {
    Actor handle = NewActor( Property::Map() );
    DALI_TEST_CHECK( !handle );
  }

  // Map with only properties
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "parent-origin", ParentOrigin::TOP_CENTER ) );
    map.push_back( Property::StringValuePair( "anchor-point", AnchorPoint::TOP_CENTER ) );
    Actor handle = NewActor( map );
    DALI_TEST_CHECK( !handle );
  }

  // Add some signals to the map, we should have no signal connections as its not yet supported
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "type", "Actor" ) );
    map.push_back( Property::StringValuePair( "signals", Property::MAP ) );
    Actor handle = NewActor( map );
    DALI_TEST_CHECK( handle );
    DALI_TEST_CHECK( !handle.MouseWheelEventSignal().GetConnectionCount() );
    DALI_TEST_CHECK( !handle.OffStageSignal().GetConnectionCount() );
    DALI_TEST_CHECK( !handle.OnStageSignal().GetConnectionCount() );
    DALI_TEST_CHECK( !handle.SetSizeSignal().GetConnectionCount() );
    DALI_TEST_CHECK( !handle.TouchedSignal().GetConnectionCount() );
  }
  END_TEST;
}
Esempio n. 2
0
void Property::Value::SetValue(const std::string& key, const Property::Value &value)
{
  DALI_ASSERT_DEBUG(Property::MAP == GetType() && "Property type invalid");

  Property::Map *container = AnyCast<Property::Map>(&(mImpl->mValue));

  if(container)
  {
    for(Property::Map::iterator iter = container->begin(); iter != container->end(); ++iter)
    {
      if(iter->first == key)
      {
        iter->second = value;
        return;
      }
    }

    // if we get here its a new key
    container->push_back(Property::StringValuePair(key, value));

  }
}
Esempio n. 3
0
int UtcDaliScriptingNewShaderEffect(void)
{
  TestApplication application;

  Property::Map programMap;
  programMap.push_back( Property::StringValuePair( "vertex-filename", "bump.vert" ) );
  programMap.push_back( Property::StringValuePair( "fragment-filename", "bump.frag" ) );

  Property::Map imageMap;
  imageMap.push_back( Property::StringValuePair( "filename", "image.png" ) );

  Property::Map map;
  map.push_back( Property::StringValuePair( "image", imageMap ) );
  map.push_back( Property::StringValuePair( "program", programMap ) );
  map.push_back( Property::StringValuePair( "uLightPosition", Vector3( 0.0, 0.0, -1.5) ) );
  map.push_back( Property::StringValuePair( "uAmbientLight", (int)10 ) );

  ShaderEffect shader = NewShaderEffect( map );

  DALI_TEST_CHECK( shader );
  END_TEST;
}
void UtcDaliPushButtonProperties()
{
    ToolkitTestApplication application;

    PushButton button = PushButton::New();
    Stage::GetCurrent().Add( button );

    // PushButton::PROPERTY_AUTO_REPEATING
    button.SetAutoRepeating( false );
    DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_AUTO_REPEATING ) );
    button.SetProperty( PushButton::PROPERTY_AUTO_REPEATING, true );
    DALI_TEST_CHECK( button.IsAutoRepeating() ) ;
    DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_AUTO_REPEATING ) );

    // PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
    button.SetInitialAutoRepeatingDelay( 10.0f );
    DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
    button.SetProperty( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, 25.0f );
    DALI_TEST_EQUALS( 25.0f, button.GetInitialAutoRepeatingDelay(), TEST_LOCATION );
    DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );

    //  PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY
    button.SetNextAutoRepeatingDelay( 3.0f );
    DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
    button.SetProperty( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY, 4.0f );
    DALI_TEST_EQUALS( 4.0f, button.GetNextAutoRepeatingDelay(), TEST_LOCATION );
    DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );

    //  PushButton::PROPERTY_TOGGLABLE
    button.SetToggleButton( false );
    DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_TOGGLABLE ) );
    button.SetProperty( PushButton::PROPERTY_TOGGLABLE, true );
    DALI_TEST_CHECK( button.IsToggleButton() ) ;
    DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_TOGGLABLE ) );

    //  PushButton::PROPERTY_TOGGLE
    button.SetToggled( false );
    DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_TOGGLE ) );
    button.SetProperty( PushButton::PROPERTY_TOGGLE, true );
    DALI_TEST_CHECK( button.IsToggled() ) ;
    DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_TOGGLE ) );

    //  PushButton::PROPERTY_NORMAL_STATE_ACTOR
    {
        button.SetButtonImage( Image::New( "IMAGE_PATH_1") );
        DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );

        Property::Map map;
        map.push_back( Property::StringValuePair( "type", "ImageActor" ) );

        button.SetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR, map );
        DALI_TEST_EQUALS( "ImageActor", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
    }

    //  PushButton::PROPERTY_PRESSED_IMAGE
    {
        button.SetPressedImage( Image::New( "IMAGE_PATH_2") );
        DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );

        Property::Map map;
        map.push_back( Property::StringValuePair( "type", "TextActor" ) );

        button.SetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR, map );
        DALI_TEST_EQUALS( "TextActor", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
    }

    //  PushButton::PROPERTY_DIMMED_STATE_ACTOR
    {
        button.SetDimmedImage( Image::New( "IMAGE_PATH_3") );
        DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );

        Property::Map map;
        map.push_back( Property::StringValuePair( "type", "Actor" ) );

        button.SetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR, map );
        DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
    }

    //  PushButton::PROPERTY_LABEL_ACTOR
    {
        button.SetLabelText( "LABEL_TEXT_CUSTOM" );
        DALI_TEST_EQUALS( "TextView", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );

        Property::Map map;
        map.push_back( Property::StringValuePair( "type", "Actor" ) );

        button.SetProperty( PushButton::PROPERTY_LABEL_ACTOR, map );
        DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
    }
}
Esempio n. 5
0
int UtcDaliScriptingNewActorChildren(void)
{
  TestApplication application;

  Property::Map map;
  map.push_back( Property::StringValuePair( "type", "Actor" ) );
  map.push_back( Property::StringValuePair( "position", Vector3::XAXIS ) );

  Property::Map child1Map;
  child1Map.push_back( Property::StringValuePair( "type", "ImageActor" ) );
  child1Map.push_back( Property::StringValuePair( "position", Vector3::YAXIS ) );

  Property::Map child2Map;
  child2Map.push_back( Property::StringValuePair( "type", "TextActor" ) );
  child2Map.push_back( Property::StringValuePair( "position", Vector3::ZAXIS ) );

  Property::Map grandChildMap;
  grandChildMap.push_back( Property::StringValuePair( "type", "LightActor" ) );
  grandChildMap.push_back( Property::StringValuePair( "position", Vector3::ONE ) );

  // Add arrays to appropriate maps
  Property::Array grandChildArray;
  grandChildArray.push_back( grandChildMap );
  Property::Array childArray;
  child1Map.push_back( Property::StringValuePair( "actors", grandChildArray ) );
  childArray.push_back( child1Map );
  childArray.push_back( child2Map );
  map.push_back( Property::StringValuePair( "actors", childArray ) );

  // Create
  Actor handle = NewActor( map );
  DALI_TEST_CHECK( handle );

  Stage::GetCurrent().Add( handle );
  application.SendNotification();
  application.Render();

  DALI_TEST_EQUALS( handle.GetCurrentPosition(), Vector3::XAXIS, TEST_LOCATION );
  DALI_TEST_EQUALS( handle.GetChildCount(), 2u, TEST_LOCATION );

  Actor child1 = handle.GetChildAt(0);
  DALI_TEST_CHECK( child1 );
  DALI_TEST_CHECK( ImageActor::DownCast( child1 ) );
  DALI_TEST_EQUALS( child1.GetCurrentPosition(), Vector3::YAXIS, TEST_LOCATION );
  DALI_TEST_EQUALS( child1.GetChildCount(), 1u, TEST_LOCATION );

  Actor child2 = handle.GetChildAt(1);
  DALI_TEST_CHECK( child2 );
  DALI_TEST_CHECK( TextActor::DownCast( child2 ) );
  DALI_TEST_EQUALS( child2.GetCurrentPosition(), Vector3::ZAXIS, TEST_LOCATION );
  DALI_TEST_EQUALS( child2.GetChildCount(), 0u, TEST_LOCATION );

  Actor grandChild = child1.GetChildAt( 0 );
  DALI_TEST_CHECK( grandChild );
  DALI_TEST_CHECK( LightActor::DownCast( grandChild ) );
  DALI_TEST_EQUALS( grandChild.GetCurrentPosition(), Vector3::ONE, TEST_LOCATION );
  DALI_TEST_EQUALS( grandChild.GetChildCount(), 0u, TEST_LOCATION );

  Stage::GetCurrent().Remove( handle );
  END_TEST;
}
Esempio n. 6
0
int UtcDaliScriptingNewActorProperties(void)
{
  TestApplication application;

  Property::Map map;
  map.push_back( Property::StringValuePair( "type", "Actor" ) );
  map.push_back( Property::StringValuePair( "size", Vector3::ONE ) );
  map.push_back( Property::StringValuePair( "position", Vector3::XAXIS ) );
  map.push_back( Property::StringValuePair( "scale", Vector3::ONE ) );
  map.push_back( Property::StringValuePair( "visible", false ) );
  map.push_back( Property::StringValuePair( "color", Color::MAGENTA ) );
  map.push_back( Property::StringValuePair( "name", "MyActor" ) );
  map.push_back( Property::StringValuePair( "color-mode", "USE_PARENT_COLOR" ) );
  map.push_back( Property::StringValuePair( "inherit-shader-effect", false ) );
  map.push_back( Property::StringValuePair( "sensitive", false ) );
  map.push_back( Property::StringValuePair( "leave-required", true ) );
  map.push_back( Property::StringValuePair( "position-inheritance", "DONT_INHERIT_POSITION" ) );
  map.push_back( Property::StringValuePair( "draw-mode", "STENCIL" ) );
  map.push_back( Property::StringValuePair( "inherit-rotation", false ) );
  map.push_back( Property::StringValuePair( "inherit-scale", false ) );

  // Default properties
  {
    Actor handle = NewActor( map );
    DALI_TEST_CHECK( handle );

    Stage::GetCurrent().Add( handle );
    application.SendNotification();
    application.Render();

    DALI_TEST_EQUALS( handle.GetCurrentSize(), Vector3::ONE, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetCurrentPosition(), Vector3::XAXIS, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetCurrentScale(), Vector3::ONE, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.IsVisible(), false, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetCurrentColor(), Color::MAGENTA, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetName(), "MyActor", TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetInheritShaderEffect(), false, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.IsSensitive(), false, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetLeaveRequired(), true, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetPositionInheritanceMode(), DONT_INHERIT_POSITION, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetDrawMode(), DrawMode::STENCIL, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.IsRotationInherited(), false, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.IsScaleInherited(), false, TEST_LOCATION );

    Stage::GetCurrent().Remove( handle );
  }

  // Check Anchor point and parent origin vector3s
  map.push_back( Property::StringValuePair( "parent-origin", ParentOrigin::TOP_CENTER ) );
  map.push_back( Property::StringValuePair( "anchor-point", AnchorPoint::TOP_LEFT ) );
  {
    Actor handle = NewActor( map );
    DALI_TEST_CHECK( handle );

    Stage::GetCurrent().Add( handle );
    application.SendNotification();
    application.Render();

    DALI_TEST_EQUALS( handle.GetCurrentParentOrigin(), ParentOrigin::TOP_CENTER, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetCurrentAnchorPoint(), AnchorPoint::TOP_LEFT, TEST_LOCATION );

    Stage::GetCurrent().Remove( handle );
  }

  // Check Anchor point and parent origin STRINGS
  map.erase( map.end() - 2, map.end() ); // delete previously added parent origin and anchor point
  map.push_back( Property::StringValuePair( "parent-origin", "BACK_TOP_LEFT" ) );
  map.push_back( Property::StringValuePair( "anchor-point", "FRONT_CENTER_LEFT" ) );
  {
    Actor handle = NewActor( map );
    DALI_TEST_CHECK( handle );

    Stage::GetCurrent().Add( handle );
    application.SendNotification();
    application.Render();

    DALI_TEST_EQUALS( handle.GetCurrentParentOrigin(), ParentOrigin::BACK_TOP_LEFT, TEST_LOCATION );
    DALI_TEST_EQUALS( handle.GetCurrentAnchorPoint(), AnchorPoint::FRONT_CENTER_LEFT, TEST_LOCATION );

    Stage::GetCurrent().Remove( handle );
  }
  END_TEST;
}
Esempio n. 7
0
int UtcDaliScriptingNewImage(void)
{
  TestApplication application;

  Property::Map map;
  map.push_back( Property::StringValuePair( "filename", "TEST_FILE" ) );

  // Filename only
  {
    Image image = NewImage( map );
    DALI_TEST_EQUALS( "TEST_FILE", image.GetFilename(), TEST_LOCATION );
  }

  // load-policy
  map.push_back( Property::StringValuePair( "load-policy", "" ) );
  {
    const StringEnum values[] =
    {
        { "IMMEDIATE", Image::Immediate },
        { "ON_DEMAND", Image::OnDemand }
    };
    TestEnumStrings< Image::LoadPolicy, Image >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &Image::GetLoadPolicy, &NewImage );
  }

  // release-policy
  map.push_back( Property::StringValuePair( "release-policy", "" ) );
  {
    const StringEnum values[] =
    {
        { "UNUSED", Image::Unused },
        { "NEVER", Image::Never }
    };
    TestEnumStrings< Image::ReleasePolicy, Image >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &Image::GetReleasePolicy, &NewImage );
  }

  // float width and height
  map.push_back( Property::StringValuePair( "width", (float) 10.0f ) );
  map.push_back( Property::StringValuePair( "height", (float) 20.0f ) );
  {
    Image image = NewImage( map );
    DALI_TEST_EQUALS( image.GetWidth(), 10.0f, TEST_LOCATION );
    DALI_TEST_EQUALS( image.GetHeight(), 20.0f, TEST_LOCATION );
  }

  // int width and height
  map.erase( map.end() - 2, map.end() );
  map.push_back( Property::StringValuePair( "width", 50 ) );
  map.push_back( Property::StringValuePair( "height", 70 ) );
  {
    Image image = NewImage( map );
    DALI_TEST_EQUALS( image.GetWidth(), 50u, TEST_LOCATION );
    DALI_TEST_EQUALS( image.GetHeight(), 70u, TEST_LOCATION );
  }

  //map.erase( map.end() - 2, map.end() );

  // pixel-format
  map.push_back( Property::StringValuePair( "pixel-format", "" ) );
  {
    const StringEnum values[] =
    {
        { "A8", Pixel::A8 },
        { "L8", Pixel::L8 },
        { "LA88", Pixel::LA88 },
        { "RGB565", Pixel::RGB565 },
        { "BGR565", Pixel::BGR565 },
        { "RGBA4444", Pixel::RGBA4444 },
        { "BGRA4444", Pixel::BGRA4444 },
        { "RGBA5551", Pixel::RGBA5551 },
        { "BGRA5551", Pixel::BGRA5551 },
        { "RGB888", Pixel::RGB888 },
        { "RGB8888", Pixel::RGB8888 },
        { "BGR8888", Pixel::BGR8888 },
        { "RGBA8888", Pixel::RGBA8888 },
        { "BGRA8888", Pixel::BGRA8888 },
        { "COMPRESSED_R11_EAC", Pixel::COMPRESSED_R11_EAC },
        { "COMPRESSED_SIGNED_R11_EAC", Pixel::COMPRESSED_SIGNED_R11_EAC },
        { "COMPRESSED_RG11_EAC", Pixel::COMPRESSED_RG11_EAC },
        { "COMPRESSED_SIGNED_RG11_EAC", Pixel::COMPRESSED_SIGNED_RG11_EAC },
        { "COMPRESSED_RGB8_ETC2", Pixel::COMPRESSED_RGB8_ETC2 },
        { "COMPRESSED_SRGB8_ETC2", Pixel::COMPRESSED_SRGB8_ETC2 },
        { "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2", Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 },
        { "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2", Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 },
        { "COMPRESSED_RGBA8_ETC2_EAC", Pixel::COMPRESSED_RGBA8_ETC2_EAC },
        { "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC", Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC },
        { "COMPRESSED_RGB8_ETC1", Pixel::COMPRESSED_RGB8_ETC1 },
        { "COMPRESSED_RGB_PVRTC_4BPPV1", Pixel::COMPRESSED_RGB_PVRTC_4BPPV1 },
        { "A8", Pixel::A8 }, // Checked already but reset so that BitmapImage works
    };
    TestEnumStrings< Pixel::Format, ImageAttributes >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &ImageAttributes::GetPixelFormat, &NewImageAttributes );
  }

  // scaling-mode
  map.push_back( Property::StringValuePair( "scaling-mode", "" ) );
  {
    const StringEnum values[] =
    {
        { "SHRINK_TO_FIT", ImageAttributes::ShrinkToFit },
        { "SCALE_TO_FILL", ImageAttributes::ScaleToFill },
        { "FIT_WIDTH", ImageAttributes::FitWidth },
        { "FIT_HEIGHT", ImageAttributes::FitHeight },
    };
    TestEnumStrings< ImageAttributes::ScalingMode, ImageAttributes >( map, values, ( sizeof( values ) / sizeof ( values[0] ) ), &ImageAttributes::GetScalingMode, &NewImageAttributes );
  }

  // crop
  map.push_back( Property::StringValuePair( "crop", Vector4( 50, 60, 70, 80 ) ) );
  {
    Image image = NewImage( map );
    ImageAttributes attributes = image.GetAttributes();
    Rect<float> crop = attributes.GetCrop();
    DALI_TEST_EQUALS( crop.x, 50, TEST_LOCATION );
    DALI_TEST_EQUALS( crop.y, 60, TEST_LOCATION );
    DALI_TEST_EQUALS( crop.width, 70, TEST_LOCATION );
    DALI_TEST_EQUALS( crop.height, 80, TEST_LOCATION );
  }

  // type FrameBufferImage
  map.push_back( Property::StringValuePair( "type", "FrameBufferImage" ) );
  {
    Image image = NewImage( map );
    DALI_TEST_CHECK( FrameBufferImage::DownCast( image ) );
  }
  // type BitMapImage
  (map.end() - 1)->second = "BitmapImage";
  {
    Image image = NewImage( map );
    DALI_TEST_CHECK( BitmapImage::DownCast( image ) );
  }
  // type Image
  (map.end() - 1)->second = "Image";
  {
    Image image = NewImage( map );
    DALI_TEST_CHECK( Image::DownCast( image ) );
    DALI_TEST_CHECK( !FrameBufferImage::DownCast( image ) );
    DALI_TEST_CHECK( !BitmapImage::DownCast( image ) );
  }
  END_TEST;
}
Esempio n. 8
0
int UtcDaliScriptingNewImageNegative(void)
{
  TestApplication application;

  // Invalid filename
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "filename", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );
  }

  // Invalid load-policy
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "load-policy", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );

    // Invalid value
    try
    {
      Property::Map map;
      map.push_back( Property::StringValuePair( "load-policy", "INVALID" ) );
      Image image = NewImage( map );
      tet_result( TET_FAIL );
    }
    catch ( DaliException& e )
    {
      DALI_TEST_ASSERT( e, "!\"Unknown", TEST_LOCATION );
    }
  }

  // Invalid release-policy
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "release-policy", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );

    // Invalid value
    try
    {
      Property::Map map;
      map.push_back( Property::StringValuePair( "release-policy", "INVALID" ) );
      Image image = NewImage( map );
      tet_result( TET_FAIL );
    }
    catch ( DaliException& e )
    {
      DALI_TEST_ASSERT( e, "!\"Unknown", TEST_LOCATION );
    }
  }

  // Invalid width
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "width", "Invalid" ) );
    map.push_back( Property::StringValuePair( "height", "Invalid" ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "value.GetType()", TEST_LOCATION );
  }

  // Invalid height
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "width", 10 ) );
    map.push_back( Property::StringValuePair( "height", "Invalid" ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "value.GetType()", TEST_LOCATION );
  }

  // Invalid pixel-format
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "pixel-format", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );

    // Invalid value
    try
    {
      Property::Map map;
      map.push_back( Property::StringValuePair( "pixel-format", "INVALID" ) );
      Image image = NewImage( map );
      tet_result( TET_FAIL );
    }
    catch ( DaliException& e )
    {
      DALI_TEST_ASSERT( e, "!\"Unknown", TEST_LOCATION );
    }
  }

  // Invalid scaling-mode
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "scaling-mode", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );

    // Invalid value
    try
    {
      Property::Map map;
      map.push_back( Property::StringValuePair( "scaling-mode", "INVALID" ) );
      Image image = NewImage( map );
      tet_result( TET_FAIL );
    }
    catch ( DaliException& e )
    {
      DALI_TEST_ASSERT( e, "!\"Unknown", TEST_LOCATION );
    }
  }

  // Invalid crop
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "crop", "Invalid" ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(field).GetType()", TEST_LOCATION );
  }

  // Invalid type
  try
  {
    Property::Map map;
    map.push_back( Property::StringValuePair( "type", Vector3::ZERO ) );
    Image image = NewImage( map );
    tet_result( TET_FAIL );
  }
  catch ( DaliException& e )
  {
    DALI_TEST_ASSERT( e, "map.GetValue(\"type\").GetType()", TEST_LOCATION );

    // Invalid value
    try
    {
      Property::Map map;
      map.push_back( Property::StringValuePair( "type", "INVALID" ) );
      Image image = NewImage( map );
      tet_result( TET_FAIL );
    }
    catch ( DaliException& e )
    {
      DALI_TEST_ASSERT( e, "!\"Unknown", TEST_LOCATION );
    }
  }
  END_TEST;
}