summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/public_methods_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/public_methods_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/javascript/public_methods_embeddertest.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/fpdfsdk/src/javascript/public_methods_embeddertest.cpp b/fpdfsdk/src/javascript/public_methods_embeddertest.cpp
index eac5264c6a..c61215aa29 100644
--- a/fpdfsdk/src/javascript/public_methods_embeddertest.cpp
+++ b/fpdfsdk/src/javascript/public_methods_embeddertest.cpp
@@ -26,13 +26,13 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
#endif // PDF_ENABLE_XFA
v8::HandleScope handle_scope(isolate());
v8::Context::Scope context_scope(GetV8Context());
- FX_BOOL bWrongFormat;
+ bool bWrongFormat;
double date;
// 1968
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"06/25/1968", L"mm/dd/yyyy",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(-47865600000, date);
EXPECT_FALSE(bWrongFormat);
@@ -40,7 +40,7 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
// 1968
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"25061968", L"ddmmyyyy",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(-47865600000, date);
EXPECT_FALSE(bWrongFormat);
@@ -48,7 +48,7 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
// 1968
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"19680625", L"yyyymmdd",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(-47865600000, date);
EXPECT_FALSE(bWrongFormat);
@@ -56,14 +56,15 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
// 1985
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"31121985", L"ddmmyyyy",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(504835200000.0, date);
EXPECT_FALSE(bWrongFormat);
// 2085, the other '85.
bWrongFormat = false;
- date = CJS_PublicMethods::MakeRegularDate(L"311285", L"ddmmyy", bWrongFormat);
+ date =
+ CJS_PublicMethods::MakeRegularDate(L"311285", L"ddmmyy", &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(3660595200000.0, date);
EXPECT_FALSE(bWrongFormat);
@@ -71,14 +72,15 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
// 1995
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"01021995", L"ddmmyyyy",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(791596800000.0, date);
EXPECT_FALSE(bWrongFormat);
// 2095, the other '95.
bWrongFormat = false;
- date = CJS_PublicMethods::MakeRegularDate(L"010295", L"ddmmyy", bWrongFormat);
+ date =
+ CJS_PublicMethods::MakeRegularDate(L"010295", L"ddmmyy", &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(3947356800000.0, date);
EXPECT_FALSE(bWrongFormat);
@@ -86,14 +88,15 @@ TEST_F(PublicMethodsEmbedderTest, MakeRegularDate) {
// 2005
bWrongFormat = false;
date = CJS_PublicMethods::MakeRegularDate(L"01022005", L"ddmmyyyy",
- bWrongFormat);
+ &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(1107216000000.0, date);
EXPECT_FALSE(bWrongFormat);
// 2005
bWrongFormat = false;
- date = CJS_PublicMethods::MakeRegularDate(L"010205", L"ddmmyy", bWrongFormat);
+ date =
+ CJS_PublicMethods::MakeRegularDate(L"010205", L"ddmmyy", &bWrongFormat);
date = RoundDownDate(date);
EXPECT_DOUBLE_EQ(1107216000000.0, date);
EXPECT_FALSE(bWrongFormat);