From 706e187ed8be44eb50bdf7024674930a4e10fa45 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 22 Oct 2018 19:34:53 +0000 Subject: Fix timezone inconsistency in document methods test. We do this by adding an override that forces GM time on everyone when run from the test harness. Generalize presubmit warnings so that the new function passes. De-duplicate lambda capture in place of static function. Change-Id: I15b34bea558baf1763476b36f0bca76614984107 Reviewed-on: https://pdfium-review.googlesource.com/c/44390 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcrt/fx_extension.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/fxcrt/fx_extension.h') diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h index c1cd188c81..38f9fd5993 100644 --- a/core/fxcrt/fx_extension.h +++ b/core/fxcrt/fx_extension.h @@ -7,6 +7,8 @@ #ifndef CORE_FXCRT_FX_EXTENSION_H_ #define CORE_FXCRT_FX_EXTENSION_H_ +#include + #include #include #include @@ -106,7 +108,12 @@ bool FXSYS_SafeLT(const T& lhs, const T& rhs) { return lhs < rhs; } +// Override time/localtime functions for test consistency. void FXSYS_SetTimeFunction(time_t (*func)()); +void FXSYS_SetLocaltimeFunction(struct tm* (*func)(const time_t*)); + +// Replacements for time/localtime that respect overrides. time_t FXSYS_time(time_t* tloc); +struct tm* FXSYS_localtime(const time_t* tp); #endif // CORE_FXCRT_FX_EXTENSION_H_ -- cgit v1.2.3