tests: Adapt InvalidStructPNext to vers 20 changes
vkAllocateMemory() now has allowed pNext structure
types as of Vulkan 1.0.20. Adjust the expected error
message for the vkAllocateMemory test to expect
the unexpected pNext structure type instead of
expecting pNext to be NULL.
Add a new sub-test using vkCreateEvent to exercise
the case where there are no allowed pNext structure
types and to expect a non-Null pNext error.
Change-Id: If4cd04adb2d8e29e7c77601404ac10bd6d325da1
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 8f071c4..f5e99d8 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -710,14 +710,30 @@
m_errorMonitor->SetDesiredFailureMsg(
VK_DEBUG_REPORT_ERROR_BIT_EXT,
- "value of pAllocateInfo->pNext must be NULL");
+ "value of pCreateInfo->pNext must be NULL");
// Set VkMemoryAllocateInfo::pNext to a non-NULL value, when pNext must be
- // NULL
+ // NULL.
+ // Need to pick a function that has no allowed pNext structure types.
+ // Expected to trigger an error with
+ // parameter_validation::validate_struct_pnext
+ VkEvent event = VK_NULL_HANDLE;
+ VkEventCreateInfo event_alloc_info;
+ // Zero-initialization will provide the correct sType
+ VkApplicationInfo app_info = {};
+ event_alloc_info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
+ event_alloc_info.pNext = &app_info;
+ vkCreateEvent(device(), &event_alloc_info, NULL, &event);
+ m_errorMonitor->VerifyFound();
+
+ m_errorMonitor->SetDesiredFailureMsg(
+ VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ " chain includes a structure with unexpected VkStructureType ");
+ // Set VkMemoryAllocateInfo::pNext to a non-NULL value, but use
+ // a function that has allowed pNext structure types and specify
+ // a structure type that is not allowed.
// Expected to trigger an error with
// parameter_validation::validate_struct_pnext
VkDeviceMemory memory = VK_NULL_HANDLE;
- // Zero-initialization will provide the correct sType
- VkApplicationInfo app_info = {};
VkMemoryAllocateInfo memory_alloc_info = {};
memory_alloc_info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
memory_alloc_info.pNext = &app_info;