Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Commit

Permalink
tests: Add extension not enabled test
Browse files Browse the repository at this point in the history
Change-Id: I7b4944c0aa58469e77e7b8218b869a17f52a273d
  • Loading branch information
mark-lunarg committed Jun 6, 2017
1 parent fac1db7 commit 115665a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/layer_validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19446,6 +19446,24 @@ TEST_F(VkLayerTest, ExecuteUnrecordedPrimaryCB) {
m_errorMonitor->VerifyFound();
}

TEST_F(VkLayerTest, ExtensionNotEnabled) {
TEST_DESCRIPTION("Validate that using an API from an unenabled extension returns an error");

// Do NOT enable VK_KHR_maintenance1
ASSERT_NO_FATAL_FAILURE(Init());
// Find address of extension API
PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR =
(PFN_vkTrimCommandPoolKHR)vkGetDeviceProcAddr(m_device->handle(), "vkTrimCommandPoolKHR");
if (vkTrimCommandPoolKHR == nullptr) {
printf(" Maintenance1 not supported by device; skipped.\n");
return;
}
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
"but its required extension VK_KHR_maintenance1 has not been enabled");
vkTrimCommandPoolKHR(m_device->handle(), m_commandPool->handle(), (VkCommandPoolTrimFlagsKHR)0);
m_errorMonitor->VerifyFound();
}

// WSI Enabled Tests
//
#if 0
Expand Down

0 comments on commit 115665a

Please sign in to comment.