@ -1940,20 +1940,20 @@ void MaterialDataTest::accessOptional() {
} } ;
} } ;
/* This exists */
/* This exists */
CORRADE_VERIFY ( data . try Attribute( " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . find Attribute( " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . try Attribute( MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_VERIFY ( data . find Attribute( MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_COMPARE ( * static_cast < const Int * > ( data . try Attribute( " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const Int * > ( data . find Attribute( " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const Int * > ( data . try Attribute( MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const Int * > ( data . find Attribute( MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
/* This doesn't */
/* This doesn't */
CORRADE_VERIFY ( ! data . try Attribute( " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute( MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_COMPARE ( data . attributeOr ( " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
}
}
@ -2030,8 +2030,8 @@ void MaterialDataTest::accessWrongType() {
data . mutableAttribute < Color3 > ( 0 ) ;
data . mutableAttribute < Color3 > ( 0 ) ;
data . mutableAttribute < Color3 > ( MaterialAttribute : : DiffuseColor ) ;
data . mutableAttribute < Color3 > ( MaterialAttribute : : DiffuseColor ) ;
data . mutableAttribute < Color3 > ( " DiffuseColor " ) ;
data . mutableAttribute < Color3 > ( " DiffuseColor " ) ;
data . try Attribute< Color3 > ( MaterialAttribute : : DiffuseColor ) ;
data . find Attribute< Color3 > ( MaterialAttribute : : DiffuseColor ) ;
data . try Attribute< Color3 > ( " DiffuseColor " ) ;
data . find Attribute< Color3 > ( " DiffuseColor " ) ;
data . attributeOr ( MaterialAttribute : : DiffuseColor , Color3 { 1.0f } ) ;
data . attributeOr ( MaterialAttribute : : DiffuseColor , Color3 { 1.0f } ) ;
data . attributeOr ( " DiffuseColor " , Color3 { 1.0f } ) ;
data . attributeOr ( " DiffuseColor " , Color3 { 1.0f } ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2041,7 +2041,7 @@ void MaterialDataTest::accessWrongType() {
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::mutableAttribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
/* try Attribute() and attributeOr() delegate to attribute() so the
/* find Attribute() and attributeOr() delegate to attribute() so the
assert is the same */
assert is the same */
" Trade::MaterialData::attribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::attribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::attribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
" Trade::MaterialData::attribute(): DiffuseColor is Trade::MaterialAttributeType::Vector4 but requested a type equivalent to Trade::MaterialAttributeType::Vector3 \n "
@ -2098,8 +2098,8 @@ void MaterialDataTest::accessWrongTypeString() {
data . mutableAttribute < Containers : : MutableStringView > ( 0 ) ;
data . mutableAttribute < Containers : : MutableStringView > ( 0 ) ;
data . mutableAttribute < Containers : : MutableStringView > ( MaterialAttribute : : Shininess ) ;
data . mutableAttribute < Containers : : MutableStringView > ( MaterialAttribute : : Shininess ) ;
data . mutableAttribute < Containers : : MutableStringView > ( " Shininess " ) ;
data . mutableAttribute < Containers : : MutableStringView > ( " Shininess " ) ;
data . try Attribute< Containers : : StringView > ( MaterialAttribute : : Shininess ) ;
data . find Attribute< Containers : : StringView > ( MaterialAttribute : : Shininess ) ;
data . try Attribute< Containers : : StringView > ( " Shininess " ) ;
data . find Attribute< Containers : : StringView > ( " Shininess " ) ;
data . attributeOr ( MaterialAttribute : : Shininess , Containers : : StringView { } ) ;
data . attributeOr ( MaterialAttribute : : Shininess , Containers : : StringView { } ) ;
data . attributeOr ( " Shininess " , Containers : : StringView { } ) ;
data . attributeOr ( " Shininess " , Containers : : StringView { } ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2109,7 +2109,7 @@ void MaterialDataTest::accessWrongTypeString() {
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
/* try Attribute() and attributeOr() delegate to attribute() so the
/* find Attribute() and attributeOr() delegate to attribute() so the
assert is the same */
assert is the same */
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a string \n "
@ -2132,8 +2132,8 @@ void MaterialDataTest::accessWrongTypeBuffer() {
data . mutableAttribute < Containers : : ArrayView < void > > ( 0 ) ;
data . mutableAttribute < Containers : : ArrayView < void > > ( 0 ) ;
data . mutableAttribute < Containers : : ArrayView < void > > ( MaterialAttribute : : Shininess ) ;
data . mutableAttribute < Containers : : ArrayView < void > > ( MaterialAttribute : : Shininess ) ;
data . mutableAttribute < Containers : : ArrayView < void > > ( " Shininess " ) ;
data . mutableAttribute < Containers : : ArrayView < void > > ( " Shininess " ) ;
data . try Attribute< Containers : : ArrayView < const void > > ( MaterialAttribute : : Shininess ) ;
data . find Attribute< Containers : : ArrayView < const void > > ( MaterialAttribute : : Shininess ) ;
data . try Attribute< Containers : : ArrayView < const void > > ( " Shininess " ) ;
data . find Attribute< Containers : : ArrayView < const void > > ( " Shininess " ) ;
data . attributeOr ( MaterialAttribute : : Shininess , Containers : : ArrayView < const void > { } ) ;
data . attributeOr ( MaterialAttribute : : Shininess , Containers : : ArrayView < const void > { } ) ;
data . attributeOr ( " Shininess " , Containers : : ArrayView < const void > { } ) ;
data . attributeOr ( " Shininess " , Containers : : ArrayView < const void > { } ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2143,7 +2143,7 @@ void MaterialDataTest::accessWrongTypeBuffer() {
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::mutableAttribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
/* try Attribute() and attributeOr() delegate to attribute() so the
/* find Attribute() and attributeOr() delegate to attribute() so the
assert is the same */
assert is the same */
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
" Trade::MaterialData::attribute(): Shininess of Trade::MaterialAttributeType::Float can't be retrieved as a buffer \n "
@ -2500,20 +2500,20 @@ void MaterialDataTest::accessLayerIndexOptional() {
} , { 1 , 3 } } ;
} , { 1 , 3 } } ;
/* This exists */
/* This exists */
CORRADE_VERIFY ( data . try Attribute( 1 , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . find Attribute( 1 , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . try Attribute( 1 , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_VERIFY ( data . find Attribute( 1 , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( 1 , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( 1 , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( 1 , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( 1 , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( 1 , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( 1 , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( 1 , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( 1 , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
/* This doesn't */
/* This doesn't */
CORRADE_VERIFY ( ! data . try Attribute( 1 , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( 1 , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute( 1 , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( 1 , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( 1 , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( 1 , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( 1 , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( 1 , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( 1 , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
}
}
@ -2527,20 +2527,20 @@ void MaterialDataTest::accessLayerNameOptional() {
} , { 1 , 4 } } ;
} , { 1 , 4 } } ;
/* This exists */
/* This exists */
CORRADE_VERIFY ( data . try Attribute( MaterialLayer : : ClearCoat , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . find Attribute( MaterialLayer : : ClearCoat , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . try Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_VERIFY ( data . find Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( MaterialLayer : : ClearCoat , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( MaterialLayer : : ClearCoat , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
/* This doesn't */
/* This doesn't */
CORRADE_VERIFY ( ! data . try Attribute( MaterialLayer : : ClearCoat , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( MaterialLayer : : ClearCoat , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialLayer : : ClearCoat , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
}
}
@ -2554,20 +2554,20 @@ void MaterialDataTest::accessLayerStringOptional() {
} , { 1 , 4 } } ;
} , { 1 , 4 } } ;
/* This exists */
/* This exists */
CORRADE_VERIFY ( data . try Attribute( " ClearCoat " , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . find Attribute( " ClearCoat " , " SpecularTexture " ) ) ;
CORRADE_VERIFY ( data . try Attribute( " ClearCoat " , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_VERIFY ( data . find Attribute( " ClearCoat " , MaterialAttribute : : SpecularTexture ) ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( " ClearCoat " , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( " ClearCoat " , " SpecularTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( " ClearCoat " , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( " ClearCoat " , MaterialAttribute : : SpecularTexture ) ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( " ClearCoat " , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( " ClearCoat " , " SpecularTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( " ClearCoat " , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( " ClearCoat " , MaterialAttribute : : SpecularTexture ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , " SpecularTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , MaterialAttribute : : SpecularTexture , 5u ) , 3 ) ;
/* This doesn't */
/* This doesn't */
CORRADE_VERIFY ( ! data . try Attribute( " ClearCoat " , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( " ClearCoat " , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute( " ClearCoat " , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute( " ClearCoat " , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( " ClearCoat " , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( " ClearCoat " , " DiffuseTexture " ) ) ;
CORRADE_VERIFY ( ! data . try Attribute< UnsignedInt > ( " ClearCoat " , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_VERIFY ( ! data . find Attribute< UnsignedInt > ( " ClearCoat " , MaterialAttribute : : DiffuseTexture ) ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , " DiffuseTexture " , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
CORRADE_COMPARE ( data . attributeOr ( " ClearCoat " , MaterialAttribute : : DiffuseTexture , 5u ) , 5 ) ;
}
}
@ -2615,10 +2615,10 @@ void MaterialDataTest::accessLayerOutOfBounds() {
data . mutableAttribute < Int > ( 2 , " AlphaMask " ) ;
data . mutableAttribute < Int > ( 2 , " AlphaMask " ) ;
data . mutableAttribute < Int > ( 2 , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Int > ( 2 , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Containers : : MutableStringView > ( 2 , 0 ) ;
data . mutableAttribute < Containers : : MutableStringView > ( 2 , 0 ) ;
data . try Attribute( 2 , " AlphaMask " ) ;
data . find Attribute( 2 , " AlphaMask " ) ;
data . try Attribute( 2 , MaterialAttribute : : AlphaMask ) ;
data . find Attribute( 2 , MaterialAttribute : : AlphaMask ) ;
data . try Attribute< bool > ( 2 , " AlphaMask " ) ;
data . find Attribute< bool > ( 2 , " AlphaMask " ) ;
data . try Attribute< bool > ( 2 , MaterialAttribute : : AlphaMask ) ;
data . find Attribute< bool > ( 2 , MaterialAttribute : : AlphaMask ) ;
data . attributeOr ( 2 , " AlphaMask " , false ) ;
data . attributeOr ( 2 , " AlphaMask " , false ) ;
data . attributeOr ( 2 , MaterialAttribute : : AlphaMask , false ) ;
data . attributeOr ( 2 , MaterialAttribute : : AlphaMask , false ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2708,10 +2708,10 @@ void MaterialDataTest::accessLayerNotFound() {
data . mutableAttribute < Int > ( " ClearCoat " , " AlphaMask " ) ;
data . mutableAttribute < Int > ( " ClearCoat " , " AlphaMask " ) ;
data . mutableAttribute < Int > ( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Int > ( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Containers : : MutableStringView > ( " ClearCoat " , 0 ) ;
data . mutableAttribute < Containers : : MutableStringView > ( " ClearCoat " , 0 ) ;
data . try Attribute( " ClearCoat " , " AlphaMask " ) ;
data . find Attribute( " ClearCoat " , " AlphaMask " ) ;
data . try Attribute( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . find Attribute( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . try Attribute< bool > ( " ClearCoat " , " AlphaMask " ) ;
data . find Attribute< bool > ( " ClearCoat " , " AlphaMask " ) ;
data . try Attribute< bool > ( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . find Attribute< bool > ( " ClearCoat " , MaterialAttribute : : AlphaMask ) ;
data . attributeOr ( " ClearCoat " , " AlphaMask " , false ) ;
data . attributeOr ( " ClearCoat " , " AlphaMask " , false ) ;
data . attributeOr ( " ClearCoat " , MaterialAttribute : : AlphaMask , false ) ;
data . attributeOr ( " ClearCoat " , MaterialAttribute : : AlphaMask , false ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2796,10 +2796,10 @@ void MaterialDataTest::accessInvalidLayerName() {
data . mutableAttribute < Int > ( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . mutableAttribute < Int > ( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . mutableAttribute < Int > ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Int > ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . mutableAttribute < Containers : : MutableStringView > ( MaterialLayer ( 0xfefe ) , 0 ) ;
data . mutableAttribute < Containers : : MutableStringView > ( MaterialLayer ( 0xfefe ) , 0 ) ;
data . try Attribute( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . find Attribute( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . try Attribute( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . find Attribute( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . try Attribute< bool > ( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . find Attribute< bool > ( MaterialLayer ( 0xfefe ) , " AlphaMask " ) ;
data . try Attribute< bool > ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . find Attribute< bool > ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask ) ;
data . attributeOr ( MaterialLayer ( 0xfefe ) , " AlphaMask " , false ) ;
data . attributeOr ( MaterialLayer ( 0xfefe ) , " AlphaMask " , false ) ;
data . attributeOr ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask , false ) ;
data . attributeOr ( MaterialLayer ( 0xfefe ) , MaterialAttribute : : AlphaMask , false ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -2988,10 +2988,10 @@ void MaterialDataTest::accessInvalidAttributeName() {
data . mutableAttribute ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . mutableAttribute ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . mutableAttribute < Int > ( 0 , MaterialAttribute ( 0x0 ) ) ;
data . mutableAttribute < Int > ( 0 , MaterialAttribute ( 0x0 ) ) ;
data . mutableAttribute < Int > ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . mutableAttribute < Int > ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . try Attribute( 0 , MaterialAttribute ( 0x0 ) ) ;
data . find Attribute( 0 , MaterialAttribute ( 0x0 ) ) ;
data . try Attribute( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . find Attribute( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . try Attribute< Int > ( 0 , MaterialAttribute ( 0x0 ) ) ;
data . find Attribute< Int > ( 0 , MaterialAttribute ( 0x0 ) ) ;
data . try Attribute< Int > ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . find Attribute< Int > ( " Layer " , MaterialAttribute ( 0xfefe ) ) ;
data . attributeOr ( 0 , MaterialAttribute ( 0x0 ) , 42 ) ;
data . attributeOr ( 0 , MaterialAttribute ( 0x0 ) , 42 ) ;
data . attributeOr ( " Layer " , MaterialAttribute ( 0xfefe ) , 42 ) ;
data . attributeOr ( " Layer " , MaterialAttribute ( 0xfefe ) , 42 ) ;
CORRADE_COMPARE ( out . str ( ) ,
CORRADE_COMPARE ( out . str ( ) ,
@ -3220,11 +3220,11 @@ void MaterialDataTest::templateLayerAccess() {
CORRADE_COMPARE ( data . mutableAttribute < UnsignedInt > ( MaterialAttribute : : LayerFactorTexture ) , 3 ) ;
CORRADE_COMPARE ( data . mutableAttribute < UnsignedInt > ( MaterialAttribute : : LayerFactorTexture ) , 3 ) ;
CORRADE_COMPARE ( data . mutableAttribute < UnsignedInt > ( " LayerFactorTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . mutableAttribute < UnsignedInt > ( " LayerFactorTexture " ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( MaterialAttribute : : LayerFactorTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( MaterialAttribute : : LayerFactorTexture ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . try Attribute( " LayerFactorTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( * static_cast < const UnsignedInt * > ( data . find Attribute( " LayerFactorTexture " ) ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( MaterialAttribute : : LayerFactorTexture ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( MaterialAttribute : : LayerFactorTexture ) , 3 ) ;
CORRADE_COMPARE ( data . try Attribute< UnsignedInt > ( " LayerFactorTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . find Attribute< UnsignedInt > ( " LayerFactorTexture " ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : LayerFactorTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( MaterialAttribute : : LayerFactorTexture , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " LayerFactorTexture " , 5u ) , 3 ) ;
CORRADE_COMPARE ( data . attributeOr ( " LayerFactorTexture " , 5u ) , 3 ) ;