8039955: [TESTBUG] jdk/lambda/LambdaTranslationTest1 - java.lang.AssertionError: expected [d:1234.000000] but found [d:1234,000000]
authorsrastogi
Wed, 15 Jun 2016 14:21:24 +0200
changeset 38964 692c18bbe423
parent 38963 31331a991a58
child 38965 2dac86c4a32d
child 39037 0f3521828775
8039955: [TESTBUG] jdk/lambda/LambdaTranslationTest1 - java.lang.AssertionError: expected [d:1234.000000] but found [d:1234,000000] Reviewed-by: psandoz
jdk/test/jdk/lambda/LambdaTranslationTest1.java
jdk/test/jdk/lambda/LambdaTranslationTest2.java
--- a/jdk/test/jdk/lambda/LambdaTranslationTest1.java	Wed Jun 15 09:11:12 2016 +0000
+++ b/jdk/test/jdk/lambda/LambdaTranslationTest1.java	Wed Jun 15 14:21:24 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -137,7 +137,7 @@
 
         LT1IA da = LambdaTranslationTest1::deye;
         da.doit(1234);
-        assertResult("d:1234.000000");
+        assertResult(String.format("d:%f", 1234.0));
 
         LT1SA a = LambdaTranslationTest1::count;
         assertEquals((Integer) 5, a.doit("howdy"));
--- a/jdk/test/jdk/lambda/LambdaTranslationTest2.java	Wed Jun 15 09:11:12 2016 +0000
+++ b/jdk/test/jdk/lambda/LambdaTranslationTest2.java	Wed Jun 15 14:21:24 2016 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, 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
@@ -200,7 +200,7 @@
         assertEquals("b1 s2", ws1.m((byte) 1, (short) 2));
 
         WidenD wd1 = LambdaTranslationTest2::pwD1;
-        assertEquals("f1.000000 d2.000000", wd1.m(1.0f, 2.0));
+        assertEquals(String.format("f%f d%f", 1.0f, 2.0), wd1.m(1.0f, 2.0));
 
         WidenI wi1 = LambdaTranslationTest2::pwI1;
         assertEquals("b1 s2 c3 i4", wi1.m((byte) 1, (short) 2, (char) 3, 4));
@@ -221,12 +221,16 @@
 
     public void testUnboxing() {
         Unbox u = LambdaTranslationTest2::pu;
-        assertEquals("b1 s2 cA i4 j5 ztrue f6.000000 d7.000000", u.m((byte)1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
+        String expected = String.format("b%d s%d c%c i%d j%d z%b f%f d%f",
+                                    (byte)1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0);
+        assertEquals(expected, u.m((byte)1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
     }
 
     public void testBoxing() {
         Box b = LambdaTranslationTest2::pb;
-        assertEquals("b1 s2 cA i4 j5 ztrue f6.000000 d7.000000", b.m((byte) 1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
+        String expected = String.format("b%d s%d c%c i%d j%d z%b f%f d%f",
+                                    (byte) 1, (short) 2, 'A', 4, 5L, true,  6.0f, 7.0);
+        assertEquals(expected, b.m((byte) 1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
     }
 
     static boolean cc(Object o) {