Skip to content

Commit 252d80c

Browse files
committed
unittest: Fix function QCHECK (issue #2517)
The function must print an error message if the condition fails. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 111ef84 commit 252d80c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unittest/log.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ static inline std::ostream& LOG(enum LogLevel level)
4545
// https://github.com/google/ion/blob/master/ion/base/logging.h
4646
static inline std::ostream& QCHECK(bool condition)
4747
{
48-
static std::ostream null_stream(nullptr);
4948
if (condition) {
50-
return std::cout;
49+
static std::ostream null_stream(nullptr);
50+
return null_stream;
5151
}
52-
return null_stream;
52+
return std::cout;
5353
}
5454

5555
#endif // TESSERACT_UNITTEST_LOG_H_

0 commit comments

Comments
 (0)