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 --- samples/pdfium_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'samples') diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index ac24bcc326..6f70c34644 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -963,7 +963,8 @@ int main(int argc, const char* argv[]) { // This must be a static var to avoid explicit capture, so the lambda can be // converted to a function ptr. static time_t time_ret = options.time; - FSDK_SetTimeFunction([]() -> time_t { return time_ret; }); + FSDK_SetTimeFunction([]() { return time_ret; }); + FSDK_SetLocaltimeFunction([](const time_t* tp) { return gmtime(tp); }); } for (const std::string& filename : files) { -- cgit v1.2.3