summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-22 19:34:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-22 19:34:53 +0000
commit706e187ed8be44eb50bdf7024674930a4e10fa45 (patch)
tree9157a2c483b35d8e2ac11f655c29322594ad8d0b /samples
parent2f62d36bfac781428f3896b443177e033be4c554 (diff)
downloadpdfium-706e187ed8be44eb50bdf7024674930a4e10fa45.tar.xz
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc3
1 files changed, 2 insertions, 1 deletions
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) {