From 6c5ea100a7d2531576037b17d5631dde42846b84 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Jun 2017 09:53:06 -0400 Subject: 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 Reviewed-by: Tom Sepez --- core/fxcrt/cfx_datetime.cpp | 6 ++++++ core/fxcrt/cfx_datetime.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'core/fxcrt') 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_; -- cgit v1.2.3