Skip to content

Commit

Permalink
tests: Cleanup unexpected in ExtensionNotEnabled
Browse files Browse the repository at this point in the history
Reduce number of missing extensions to one for consistent, clean results
on 1.1 and 1.0.

Change-Id: Ic7a3ef6de16e604e700ed46766723214106c0e3f
  • Loading branch information
jzulauf-lunarg committed Sep 12, 2018
1 parent 1909e6a commit 000b38a
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions tests/layer_validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23823,16 +23823,26 @@ TEST_F(VkLayerTest, ExecuteSecondaryCBWithLayoutMismatch) {
TEST_F(VkLayerTest, ExtensionNotEnabled) {
TEST_DESCRIPTION("Validate that using an API from an unenabled extension returns an error");

ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));

// Do NOT enable prerequesite extensions for YCBCR...
// Do NOT enable VK_KHR_maintenance1
if (DeviceExtensionSupported(gpu(), nullptr, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) {
m_device_extension_names.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
if (InstanceExtensionSupported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) {
m_instance_extension_names.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
} else {
printf("%s test requires KHR YCBR conversion extension, not available. Skipping.\n", kSkipPrefix);
printf("%s Did not find required instance extension %s; skipped.\n", kSkipPrefix,
VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
return;
}
ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));

// Required extensions except VK_KHR_GET_MEMORY_REQUIREMENTS_2 -- to create the needed error
std::vector<const char *> required_device_extensions = {VK_KHR_MAINTENANCE1_EXTENSION_NAME, VK_KHR_BIND_MEMORY_2_EXTENSION_NAME,
VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME};
for (auto dev_ext : required_device_extensions) {
if (DeviceExtensionSupported(gpu(), nullptr, dev_ext)) {
m_device_extension_names.push_back(dev_ext);
} else {
printf("%s Did not find required device extension %s; skipped.\n", kSkipPrefix, dev_ext);
break;
}
}

// Need to ignore this error to get to the one we're testing
m_errorMonitor->SetUnexpectedError("VUID-vkCreateDevice-ppEnabledExtensionNames-01387");
Expand Down

0 comments on commit 000b38a

Please sign in to comment.