summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/fx_string_testhelpers.cpp10
-rw-r--r--testing/fx_string_testhelpers.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp
index 934dd680e4..00a13f5b57 100644
--- a/testing/fx_string_testhelpers.cpp
+++ b/testing/fx_string_testhelpers.cpp
@@ -6,6 +6,7 @@
#include <iomanip>
#include <ios>
+#include <string>
namespace {
@@ -46,3 +47,12 @@ std::ostream& operator<<(std::ostream& out, const CFX_WideStringC& str) {
std::ostream& operator<<(std::ostream& out, const CFX_WideString& str) {
return output_string(out, str);
}
+
+std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt) {
+ os << dt.GetYear() << "-" << std::to_string(dt.GetMonth()) << "-"
+ << std::to_string(dt.GetDay()) << " " << std::to_string(dt.GetHour())
+ << ":" << std::to_string(dt.GetMinute()) << ":"
+ << std::to_string(dt.GetSecond()) << "."
+ << std::to_string(dt.GetMillisecond());
+ return os;
+}
diff --git a/testing/fx_string_testhelpers.h b/testing/fx_string_testhelpers.h
index 82552d7227..caa233049a 100644
--- a/testing/fx_string_testhelpers.h
+++ b/testing/fx_string_testhelpers.h
@@ -7,6 +7,7 @@
#include <ostream>
+#include "core/fxcrt/cfx_datetime.h"
#include "core/fxcrt/fx_string.h"
// Output stream operator so GTEST macros work with FX strings.
@@ -15,4 +16,7 @@ std::ostream& operator<<(std::ostream& out, const CFX_ByteString& str);
std::ostream& operator<<(std::ostream& out, const CFX_WideStringC& str);
std::ostream& operator<<(std::ostream& out, const CFX_WideString& str);
+// Output stream operator so GTEST macros work with CFX_DateTime objects.
+std::ostream& operator<<(std::ostream& os, const CFX_DateTime& dt);
+
#endif // TESTING_FX_STRING_TESTHELPERS_H_