Skip to content

Commit

Permalink
8214195: Align stdout messages in test/jdk/java/math/BigInteger/Primi…
Browse files Browse the repository at this point in the history
…tiveConversionTests.java

Backport-of: 389a110
  • Loading branch information
shipilev committed Aug 13, 2021
1 parent bdfc60a commit b117ecc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/jdk/java/math/BigInteger/PrimitiveConversionTests.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -63,6 +63,7 @@ public class PrimitiveConversionTests {
}

public static int testDoubleValue() {
System.out.println("--- testDoubleValue ---");
int failures = 0;
for (BigInteger big : ALL_BIGINTEGER_CANDIDATES) {
double expected = Double.parseDouble(big.toString());
Expand All @@ -71,14 +72,16 @@ public static int testDoubleValue() {
// should be bitwise identical
if (Double.doubleToRawLongBits(expected) != Double
.doubleToRawLongBits(actual)) {
System.out.println(big);
System.out.format("big: %s, expected: %f, actual: %f%n",
big, expected, actual);
failures++;
}
}
return failures;
}

public static int testFloatValue() {
System.out.println("--- testFloatValue ---");
int failures = 0;
for (BigInteger big : ALL_BIGINTEGER_CANDIDATES) {
float expected = Float.parseFloat(big.toString());
Expand All @@ -87,7 +90,8 @@ public static int testFloatValue() {
// should be bitwise identical
if (Float.floatToRawIntBits(expected) != Float
.floatToRawIntBits(actual)) {
System.out.println(big + " " + expected + " " + actual);
System.out.format("big: %s, expected: %f, actual: %f%n",
big, expected, actual);
failures++;
}
}
Expand Down

1 comment on commit b117ecc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.