Skip to content

Commit

Permalink
fix testIsFloat and testIsDouble
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Nov 30, 2021
1 parent 0c21f03 commit e89b760
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions java/src/test/java/ai/rapids/cudf/ColumnVectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4919,11 +4919,12 @@ void testIsFloat() {
try (ColumnVector floatStringCV = ColumnVector.fromStrings(floatStrings);
ColumnVector isFloat = floatStringCV.isFloat();
ColumnVector floats = floatStringCV.asFloats();
ColumnVector expectedFloats = ColumnVector.fromBoxedFloats(0f, 0f, Float.POSITIVE_INFINITY,
Float.NEGATIVE_INFINITY, 0f, 0f, -0f, 0f, Float.MAX_VALUE, Float.POSITIVE_INFINITY,
-Float.MAX_VALUE, Float.NEGATIVE_INFINITY, 1.2e-24f, 0f, 0f, null, 423f);
ColumnVector expected = ColumnVector.fromBoxedBooleans(false, false, true, true, false,
false, true, true, true, true, true, true, true, false, false, null, true)) {
ColumnVector expectedFloats = ColumnVector.fromBoxedFloats(0f, Float.NaN, Float.POSITIVE_INFINITY,
Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, -0f, 0f,
Float.MAX_VALUE, Float.POSITIVE_INFINITY, -Float.MAX_VALUE, Float.NEGATIVE_INFINITY,
1.2e-24f, 0f, 0f, null, 423f);
ColumnVector expected = ColumnVector.fromBoxedBooleans(false, true, true, true, true,
true, true, true, true, true, true, true, true, false, false, null, true)) {
assertColumnsAreEqual(expected, isFloat);
assertColumnsAreEqual(expectedFloats, floats);
}
Expand All @@ -4944,12 +4945,12 @@ void testIsDouble() {
try (ColumnVector doubleStringCV = ColumnVector.fromStrings(doubleStrings);
ColumnVector isDouble = doubleStringCV.isFloat();
ColumnVector doubles = doubleStringCV.asDoubles();
ColumnVector expectedDoubles = ColumnVector.fromBoxedDoubles(0d, 0d,
Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0d, 0d, -0d, 0d, Double.MAX_VALUE,
Double.POSITIVE_INFINITY, -Double.MAX_VALUE, Double.NEGATIVE_INFINITY, 1.2e-234d, 0d,
0d, null, 423d);
ColumnVector expected = ColumnVector.fromBoxedBooleans(false, false, true, true, false,
false, true, true, true, true, true, true, true, false, false, null, true)) {
ColumnVector expectedDoubles = ColumnVector.fromBoxedDoubles(0d, Double.NaN,
Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY,
-0d, 0d, Double.MAX_VALUE, Double.POSITIVE_INFINITY, -Double.MAX_VALUE, Double.NEGATIVE_INFINITY,
1.2e-234d, 0d, 0d, null, 423d);
ColumnVector expected = ColumnVector.fromBoxedBooleans(false, true, true, true, true,
true, true, true, true, true, true, true, true, false, false, null, true)) {
assertColumnsAreEqual(expected, isDouble);
assertColumnsAreEqual(expectedDoubles, doubles);
}
Expand Down

0 comments on commit e89b760

Please sign in to comment.