Skip to content

Commit 0810f1d

Browse files
Fix gtest printing
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
1 parent 072050d commit 0810f1d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

SilKit/IntegrationTests/ITest_DynStepSizes.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,14 @@
88
#include <chrono>
99
#include <iostream>
1010

11-
#include "ITestFixture.hpp"
12-
1311
using namespace std::chrono_literals;
1412

15-
template <typename Rep, typename Period>
16-
inline std::ostream& operator<<(std::ostream& out, const std::chrono::duration <Rep, Period> timestamp)
17-
{
18-
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(timestamp);
19-
out << ns.count() << "ns";
20-
return out;
21-
}
22-
13+
namespace std {
2314
template <typename Rep, typename Period>
2415
void PrintTo(const std::chrono::duration<Rep, Period>& d, std::ostream* os)
2516
{
2617
*os << std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() << "ns";
2718
}
28-
2919
template <typename R1, typename P1, typename R2, typename P2>
3020
inline void PrintTo(const std::pair<std::chrono::duration<R1, P1>, std::chrono::duration<R2, P2>>& p, std::ostream* os)
3121
{
@@ -35,6 +25,8 @@ inline void PrintTo(const std::pair<std::chrono::duration<R1, P1>, std::chrono::
3525
PrintTo(p.second, os);
3626
*os << ")";
3727
}
28+
} // namespace std
29+
3830
inline std::string ToString(const std::chrono::nanoseconds& ns)
3931
{
4032
std::ostringstream os;
@@ -52,7 +44,7 @@ inline std::string ToString(const std::pair<std::chrono::nanoseconds, std::chron
5244
return os.str();
5345
}
5446

55-
#include "gtest/gtest.h"
47+
#include "ITestFixture.hpp"
5648

5749
namespace {
5850

0 commit comments

Comments
 (0)