Skip to content

Commit

Permalink
Use new Nan definition in math function test
Browse files Browse the repository at this point in the history
  • Loading branch information
rschlussel committed Apr 3, 2024
1 parent 1a4f99b commit f0a642f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ protected AbstractTestFunctions(FeaturesConfig config)
protected AbstractTestFunctions(Session session, FeaturesConfig config)
{
this.session = requireNonNull(session, "session is null");
this.config = requireNonNull(config, "config is null").setLegacyLogFunction(true);
this.config = requireNonNull(config, "config is null")
.setLegacyLogFunction(true)
.setUseNewNanDefinition(true);
}

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,6 @@ public void testGreatest()
assertFunction("greatest(1.0, 2.0E0)", DOUBLE, 2.0);
assertDecimalFunction("greatest(5, 4, 3.0, 2)", decimal("0000000005.0"));

// invalid
assertInvalidFunction("greatest(1.5E0, 0.0E0 / 0.0E0)", "Invalid argument to greatest(): NaN");

// argument count limit
tryEvaluateWithAll("greatest(" + Joiner.on(", ").join(nCopies(127, "rand()")) + ")", DOUBLE);
assertNotSupported(
Expand Down Expand Up @@ -1204,6 +1201,7 @@ public void testLeast()
@Test
public void testGreatestWithNaN()
{
// this test runs with useNewNanDefinition=false, as that is the default value
assertFunction("greatest(1.5E0, 0.0E0 / 0.0E0)", DOUBLE, Double.NaN);
assertFunction("greatest(REAL '1.5E0', REAL '0.0' / REAL '0.0')", REAL, Float.NaN);
}
Expand Down

0 comments on commit f0a642f

Please sign in to comment.