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 <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index ac24bcc..6f70c34 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -963,7 +963,8 @@
// 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) {