MCPcopy Create free account
hub / github.com/SOUI2/soui / printFailure

Method printFailure

third-part/jsoncpp/src/test_lib_json/jsontest.cpp:153–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void TestResult::printFailure(bool printTestName) const {
154 if (failures_.empty()) {
155 return;
156 }
157
158 if (printTestName) {
159 printf("* Detail of %s test failure:\n", name_.c_str());
160 }
161
162 // Print in reverse to display the callstack in the right order
163 Failures::const_iterator itEnd = failures_.end();
164 for (Failures::const_iterator it = failures_.begin(); it != itEnd; ++it) {
165 const Failure& failure = *it;
166 JSONCPP_STRING indent(failure.nestingLevel_ * 2, ' ');
167 if (failure.file_) {
168 printf("%s%s(%d): ", indent.c_str(), failure.file_, failure.line_);
169 }
170 if (!failure.expr_.empty()) {
171 printf("%s\n", failure.expr_.c_str());
172 } else if (failure.file_) {
173 printf("\n");
174 }
175 if (!failure.message_.empty()) {
176 JSONCPP_STRING reindented = indentText(failure.message_, indent + " ");
177 printf("%s\n", reindented.c_str());
178 }
179 }
180}
181
182JSONCPP_STRING TestResult::indentText(const JSONCPP_STRING& text,
183 const JSONCPP_STRING& indent) {

Callers 1

runAllTestMethod · 0.80

Calls 4

emptyMethod · 0.45
c_strMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected