@ -47,6 +47,7 @@ struct ExtensionPropertiesVkTest: TestSuite::Tester {
void enumerateInstanceWithKhronosValidationLayer ( ) ;
void enumerateInstanceWithKhronosValidationLayer ( ) ;
void enumerateInstanceNonexistentLayer ( ) ;
void enumerateInstanceNonexistentLayer ( ) ;
void instanceExtensionIsSupported ( ) ;
void instanceExtensionIsSupported ( ) ;
void instanceExtensionIsSupportedRevision ( ) ;
/* Device extensions tested in DevicePropertiesVkTest */
/* Device extensions tested in DevicePropertiesVkTest */
void outOfRange ( ) ;
void outOfRange ( ) ;
@ -60,6 +61,7 @@ ExtensionPropertiesVkTest::ExtensionPropertiesVkTest() {
& ExtensionPropertiesVkTest : : enumerateInstanceWithKhronosValidationLayer ,
& ExtensionPropertiesVkTest : : enumerateInstanceWithKhronosValidationLayer ,
& ExtensionPropertiesVkTest : : enumerateInstanceNonexistentLayer ,
& ExtensionPropertiesVkTest : : enumerateInstanceNonexistentLayer ,
& ExtensionPropertiesVkTest : : instanceExtensionIsSupported ,
& ExtensionPropertiesVkTest : : instanceExtensionIsSupported ,
& ExtensionPropertiesVkTest : : instanceExtensionIsSupportedRevision ,
& ExtensionPropertiesVkTest : : outOfRange ,
& ExtensionPropertiesVkTest : : outOfRange ,
& ExtensionPropertiesVkTest : : namedRevision } ) ;
& ExtensionPropertiesVkTest : : namedRevision } ) ;
@ -161,6 +163,9 @@ void ExtensionPropertiesVkTest::instanceExtensionIsSupported() {
}
}
CORRADE_VERIFY ( ! properties . isSupported ( " VK_this_doesnt_exist " ) ) ;
CORRADE_VERIFY ( ! properties . isSupported ( " VK_this_doesnt_exist " ) ) ;
/* Verify that we don't dereference garbage when std::lower_bound() returns
` last ` */
CORRADE_VERIFY ( ! properties . isSupported ( " ZZZZZ " ) ) ;
/* Verify that we're not just comparing a prefix */
/* Verify that we're not just comparing a prefix */
const std : : string extension = std : : string ( properties . name ( 0 ) ) + " _hello " ;
const std : : string extension = std : : string ( properties . name ( 0 ) ) + " _hello " ;
@ -175,6 +180,22 @@ void ExtensionPropertiesVkTest::instanceExtensionIsSupported() {
CORRADE_VERIFY ( properties . isSupported ( Extensions : : KHR : : get_physical_device_properties2 { } ) ) ;
CORRADE_VERIFY ( properties . isSupported ( Extensions : : KHR : : get_physical_device_properties2 { } ) ) ;
}
}
void ExtensionPropertiesVkTest : : instanceExtensionIsSupportedRevision ( ) {
InstanceExtensionProperties properties = enumerateInstanceExtensionProperties ( ) ;
/** @todo use Extensions::KHR::surface once the extension is recognized */
if ( ! properties . isSupported ( " VK_KHR_get_physical_device_properties2 " ) )
CORRADE_SKIP ( " VK_KHR_get_physical_device_properties2 not supported, can't test " ) ;
UnsignedInt revision = properties . revision ( " VK_KHR_get_physical_device_properties2 " ) ;
CORRADE_VERIFY ( properties . isSupported ( " VK_KHR_get_physical_device_properties2 " , revision ) ) ;
CORRADE_VERIFY ( properties . isSupported < Extensions : : KHR : : get_physical_device_properties2 > ( revision ) ) ;
CORRADE_VERIFY ( properties . isSupported ( Extensions : : KHR : : get_physical_device_properties2 { } , revision ) ) ;
CORRADE_VERIFY ( ! properties . isSupported ( " VK_KHR_get_physical_device_properties2 " , revision + 1 ) ) ;
CORRADE_VERIFY ( ! properties . isSupported < Extensions : : KHR : : get_physical_device_properties2 > ( revision + 1 ) ) ;
CORRADE_VERIFY ( ! properties . isSupported ( Extensions : : KHR : : get_physical_device_properties2 { } , revision + 1 ) ) ;
}
void ExtensionPropertiesVkTest : : outOfRange ( ) {
void ExtensionPropertiesVkTest : : outOfRange ( ) {
# ifdef CORRADE_NO_ASSERT
# ifdef CORRADE_NO_ASSERT
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;
CORRADE_SKIP ( " CORRADE_NO_ASSERT defined, can't test assertions " ) ;