MCPcopy Create free account
hub / github.com/Kitware/VTK / HasWarningMessage

Function HasWarningMessage

Testing/Core/vtkTestErrorObserver.h:130–150  ·  view source on GitHub ↗

* Check to see if a warning message exists. * Given an observer, a message and a status with an initial value, * Returns false if an warning does not exist, or if msg is not contained * in the warning message. * Returns true if the warning exists and msg is contained in the warning * message. * * If the test fails, it reports the failing message, prepended with "ERROR:". *

Source from the content-addressed store, hash-verified

128 * see CheckWarningMessage
129 */
130 bool HasWarningMessage(const std::string& expectedMsg)
131 {
132 if (!this->GetWarning())
133 {
134 std::cout << "ERROR: Failed to catch any warning. Expected the warning message to contain \""
135 << expectedMsg << '\"' << std::endl;
136 return false;
137 }
138 else
139 {
140 std::string gotMsg(this->GetWarningMessage());
141 if (gotMsg.find(expectedMsg) == std::string::npos)
142 {
143 std::cout << "ERROR: Warning message does not contain \"" << expectedMsg << "\" got \n\""
144 << gotMsg << '\"' << std::endl;
145 return false;
146 }
147 }
148
149 return true;
150 }
151
152 /**
153 * Check to see if a warning message exists.

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected