Skip to content

Commit 8951004

Browse files
committed
Fix clang-tidy performance-avoid-endl warning
Use '\n' instead of std::endl since USES_TERMINAL now handles output buffering at the CMake level.
1 parent 9b70460 commit 8951004

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_with_catch/catch.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ int main(int argc, char *argv[]) {
120120
setenv("PYTHONPATH", updated_pythonpath.c_str(), /*replace=*/1);
121121
#endif
122122

123-
std::cout << "[ STARTING ] " << get_utc_timestamp() << std::endl;
123+
std::cout << "[ STARTING ] " << get_utc_timestamp() << '\n';
124+
std::cout.flush();
124125

125126
py::scoped_interpreter guard{};
126127

127128
auto result = Catch::Session().run(argc, argv);
128129

129-
std::cout << "[ DONE ] " << get_utc_timestamp() << " (result " << result << ")"
130-
<< std::endl;
130+
std::cout << "[ DONE ] " << get_utc_timestamp() << " (result " << result << ")\n";
131+
std::cout.flush();
131132

132133
return result < 0xff ? result : 0xff;
133134
}

0 commit comments

Comments
 (0)