tests: Fix layer validation tests error handler
- Fix error handler to work properly on positive tests
when there are multiple errors.
Change-Id: I339d0a0b7248fa2bb159259283b0e94a52d58a36
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 04ee198..035db79 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -149,7 +149,12 @@
string errorString(msgString);
bool found_expected = false;
for (auto desired_msg : m_desiredMsgs) {
- if (errorString.find(desired_msg) != string::npos) {
+ if (desired_msg.length() == 0) {
+ // An empty desired_msg string "" indicates a positive test - not expecting an error.
+ // Return true to avoid calling layers/driver with this error.
+ // And don't erase the "" string, so it remains if another error is found.
+ result = VK_TRUE;
+ } else if (errorString.find(desired_msg) != string::npos) {
found_expected = true;
m_failureMsgs.insert(errorString);
m_msgFound = VK_TRUE;