Add more test cases for CFXJSE_FormCalcContextEmbedderTest.Time2Num. Leave some TODOs for calculations that are wrong. Change-Id: I6d47097edf627a6a24b1f803e90dee42b8965972 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/78733 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp b/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp index 0b5ac5a..7f6b8b8 100644 --- a/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp +++ b/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
@@ -514,7 +514,13 @@ const char* program; int result; } tests[] = { - // {"Time2Num(\"00:00:00 GMT\", \"HH:MM:SS Z\")", 1}, + // TODO(thestig): Should be 1. + {"Time2Num(\"00:00:00 GMT\", \"HH:MM:SS Z\")", 86400001}, + // TODO(thestig): Should be 1001. + {"Time2Num(\"00:00:01 GMT\", \"HH:MM:SS Z\")", 86401001}, + {"Time2Num(\"00:01:00 GMT\", \"HH:MM:SS Z\")", 60001}, + {"Time2Num(\"01:00:00 GMT\", \"HH:MM:SS Z\")", 3600001}, + {"Time2Num(\"23:59:59 GMT\", \"HH:MM:SS Z\")", 86399001}, {"Time2Num(\"\", \"\", 1)", 0}, // https://crbug.com/pdfium/1257 {"Time2Num(\"13:13:13 GMT\", \"HH:MM:SS Z\", \"fr_FR\")", 47593001}, };