tests: Check for expected ids as well as messages
authorTony Barbour <tony@LunarG.com>
Thu, 3 Nov 2016 19:31:28 +0000 (13:31 -0600)
committerTony Barbour <tony@LunarG.com>
Thu, 3 Nov 2016 20:02:59 +0000 (14:02 -0600)
Also don't print other error message if there weren't other errors
Change-Id: Ia303370d1ce7ae329f6305ad3e66266c8c64ff40

tests/layer_validation_tests.cpp

index ae357f1..55203fb 100644 (file)
@@ -222,9 +222,11 @@ class ErrorMonitor {
 
     void DumpFailureMsgs(void) {
         vector<string> otherMsgs = GetOtherFailureMsgs();
-        cout << "Other error messages logged for this test were:" << endl;
-        for (auto iter = otherMsgs.begin(); iter != otherMsgs.end(); iter++) {
-            cout << "     " << *iter << endl;
+        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;
+            }
         }
     }
 
@@ -244,6 +246,9 @@ class ErrorMonitor {
             for (auto desired_msg : m_desired_message_strings) {
                 FAIL() << "Did not receive expected error '" << desired_msg << "'";
             }
+            for (auto desired_id : m_desired_message_ids) {
+                FAIL() << "Did not receive expected error '" << desired_id << "'";
+            }
         }
     }