Re-enable formcalc tests that are sufficiently precise
Use EXPECT_NEAR() to make sure these are good to N decimal points.
Change-Id: I0ca0a87f6a4775dae96a3d9e8c31c57851799ad9
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/69152
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp b/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
index e74be87..4803df6 100644
--- a/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
+++ b/fxjs/xfa/cfxjse_formcalc_context_embeddertest.cpp
@@ -612,7 +612,7 @@
}
}
-TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Apr) {
+TEST_F(CFXJSE_FormCalcContextEmbedderTest, Apr) {
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
struct {
@@ -626,7 +626,7 @@
CFXJSE_Value* value = GetValue();
EXPECT_TRUE(value->IsNumber());
- EXPECT_FLOAT_EQ(tests[i].result, value->ToFloat())
+ EXPECT_NEAR(tests[i].result, value->ToFloat(), 0.000001)
<< "Program: " << tests[i].program;
}
}
@@ -774,7 +774,7 @@
}
}
-TEST_F(CFXJSE_FormCalcContextEmbedderTest, DISABLED_Rate) {
+TEST_F(CFXJSE_FormCalcContextEmbedderTest, Rate) {
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
struct {
@@ -788,7 +788,7 @@
CFXJSE_Value* value = GetValue();
EXPECT_TRUE(value->IsNumber());
- EXPECT_FLOAT_EQ(tests[i].result, value->ToFloat())
+ EXPECT_NEAR(tests[i].result, value->ToFloat(), 0.000001)
<< "Program: " << tests[i].program;
}
}