tests: Expect two errors in one call, in InvalidUsageBits
This previously made the same call twice, looking for each of the two errors individually -- which leaked the other of the pair each time as an unexpected error.
Just expect both and do it once.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 0c5ce1c..a797173 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -3038,15 +3038,14 @@
region.imageExtent.width = 16;
region.imageExtent.depth = 1;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Invalid usage flag for buffer ");
// Buffer usage not set to TRANSFER_SRC and image usage not set to
// TRANSFER_DST
BeginCommandBuffer();
- vkCmdCopyBufferToImage(m_commandBuffer->GetBufferHandle(), buffer.handle(), image.handle(),
- VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion);
- m_errorMonitor->VerifyFound();
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "Invalid usage flag for image ");
+ // two separate errors from this call:
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "image should have VK_IMAGE_USAGE_TRANSFER_DST_BIT");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "buffer should have VK_BUFFER_USAGE_TRANSFER_SRC_BIT");
+
vkCmdCopyBufferToImage(m_commandBuffer->GetBufferHandle(), buffer.handle(), image.handle(),
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion);
m_errorMonitor->VerifyFound();