summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-06-05 09:53:06 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-05 14:11:19 +0000
commit6c5ea100a7d2531576037b17d5631dde42846b84 (patch)
tree70a5d02ef15a4354448be93926d79b5437c1b84c /core
parent7211eac14643bbbaf41bfc205c244668f46be440 (diff)
downloadpdfium-6c5ea100a7d2531576037b17d5631dde42846b84.tar.xz
Add start of CFGAS_FormatString tests
This CL adds tests for the date parsing and formatting code in CFGAS_FormatString. Change-Id: I9989cdd1b3f92c90d46ee2c3f7838fe1de255be2 Reviewed-on: https://pdfium-review.googlesource.com/6178 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxcrt/cfx_datetime.cpp6
-rw-r--r--core/fxcrt/cfx_datetime.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_datetime.cpp b/core/fxcrt/cfx_datetime.cpp
index dcf25d5463..833fe58907 100644
--- a/core/fxcrt/cfx_datetime.cpp
+++ b/core/fxcrt/cfx_datetime.cpp
@@ -127,3 +127,9 @@ int32_t CFX_DateTime::GetDayOfWeek() const {
v += 7;
return v;
}
+
+bool CFX_DateTime::operator==(const CFX_DateTime& other) const {
+ return year_ == other.year_ && month_ == other.month_ && day_ == other.day_ &&
+ hour_ == other.hour_ && minute_ == other.minute_ &&
+ second_ == other.second_ && millisecond_ == other.millisecond_;
+}
diff --git a/core/fxcrt/cfx_datetime.h b/core/fxcrt/cfx_datetime.h
index 2de75c4e38..272c2496cc 100644
--- a/core/fxcrt/cfx_datetime.h
+++ b/core/fxcrt/cfx_datetime.h
@@ -79,6 +79,8 @@ class CFX_DateTime {
uint16_t GetMillisecond() const { return millisecond_; }
int32_t GetDayOfWeek() const;
+ bool operator==(const CFX_DateTime& other) const;
+
private:
int32_t year_;
uint8_t month_;