From b9776c71718bba353225e6a2010cf0ab1e926658 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Fri, 23 Jun 2017 15:03:50 -0400 Subject: Adding back the CFX_DateTime print helpers. Change-Id: I23fe37139ed06a7e09f6a39ea833a6a984add49e Reviewed-on: https://pdfium-review.googlesource.com/6913 Reviewed-by: Tom Sepez Reviewed-by: dsinclair Commit-Queue: dsinclair --- testing/fx_string_testhelpers.cpp | 18 ++++++++++++++++++ testing/fx_string_testhelpers.h | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 testing/fx_string_testhelpers.cpp create mode 100644 testing/fx_string_testhelpers.h (limited to 'testing') diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp new file mode 100644 index 0000000000..443cc89ed1 --- /dev/null +++ b/testing/fx_string_testhelpers.cpp @@ -0,0 +1,18 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "testing/fx_string_testhelpers.h" + +#include +#include +#include + +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 new file mode 100644 index 0000000000..34ac69dab4 --- /dev/null +++ b/testing/fx_string_testhelpers.h @@ -0,0 +1,15 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TESTING_FX_STRING_TESTHELPERS_H_ +#define TESTING_FX_STRING_TESTHELPERS_H_ + +#include + +#include "core/fxcrt/cfx_datetime.h" + +// 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_ -- cgit v1.2.3