Revert "tests: Fail on unexpected errors"
This reverts commit bc230cab8dfa71848d4c81af8c6ce718e56d2711.
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 6e67a27..436736e 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -229,6 +229,7 @@
}
if (!found_expected) {
+ printf("Unexpected: %s\n", msgString);
other_messages_.push_back(errorString);
}
}
@@ -237,6 +238,8 @@
return result;
}
+ vector<string> GetOtherFailureMsgs(void) const { return other_messages_; }
+
VkDebugReportFlagsEXT GetMessageFlags(void) const { return message_flags_; }
VkBool32 AnyDesiredMsgFound(void) const { return message_found_; }
@@ -245,11 +248,12 @@
void SetBailout(bool *bailout) { bailout_ = bailout; }
- void ReportUnexpectedErrors(void) const {
- if (other_messages_.size() > 0) {
- cout << "Unexpected error messages logged for this test are:" << endl;
- for (auto const &msg : other_messages_) {
- ADD_FAILURE() << " " << msg;
+ void DumpFailureMsgs(void) const {
+ vector<string> otherMsgs = GetOtherFailureMsgs();
+ if (otherMsgs.size()) {
+ cout << "Other error messages logged for this test were:" << endl;
+ for (auto iter = otherMsgs.begin(); iter != otherMsgs.end(); iter++) {
+ cout << " " << *iter << endl;
}
}
}
@@ -266,6 +270,7 @@
void VerifyFound() {
// Not seeing the desired message is a failure. /Before/ throwing, dump any other messages.
if (!AllDesiredMsgsFound()) {
+ DumpFailureMsgs();
for (auto desired_msg : desired_message_strings_) {
ADD_FAILURE() << "Did not receive expected error '" << desired_msg << "'";
}
@@ -273,22 +278,17 @@
ADD_FAILURE() << "Did not receive expected error ENUM '" << desired_id << "'";
}
}
-
- ReportUnexpectedErrors();
-
Reset();
}
void VerifyNotFound() {
// ExpectSuccess() configured us to match anything. Any error is a failure.
if (AnyDesiredMsgFound()) {
+ DumpFailureMsgs();
for (auto msg : failure_message_strings_) {
ADD_FAILURE() << "Expected to succeed but got error: " << msg;
}
}
-
- ReportUnexpectedErrors();
-
Reset();
}
@@ -418,11 +418,6 @@
virtual void TearDown() {
// Clean up resources before we reset
ShutdownFramework();
-
- // Shutting down the framework may have triggered some unexpected errors. Let's check one last time before we destroy the
- // error monitor.
- m_errorMonitor->ReportUnexpectedErrors();
-
delete m_errorMonitor;
}