Skip to content

Commit 41c7d2d

Browse files
zzambersjerboaa
authored andcommittedAug 24, 2022
8039955: [TESTBUG] jdk/lambda/LambdaTranslationTest1 - java.lang.AssertionError: expected [d:1234.000000] but found [d:1234,000000]
Backport-of: 3555038f51fbf7f908b7346a8329f4da44a7cde5
1 parent a4d4973 commit 41c7d2d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎jdk/test/jdk/lambda/LambdaTranslationTest1.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ public void testMethodRefs() {
137137

138138
LT1IA da = LambdaTranslationTest1::deye;
139139
da.doit(1234);
140-
assertResult("d:1234.000000");
140+
assertResult(String.format("d:%f", 1234.0));
141141

142142
LT1SA a = LambdaTranslationTest1::count;
143143
assertEquals((Integer) 5, a.doit("howdy"));

‎jdk/test/jdk/lambda/LambdaTranslationTest2.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -200,7 +200,7 @@ public void testPrimitiveWidening() {
200200
assertEquals("b1 s2", ws1.m((byte) 1, (short) 2));
201201

202202
WidenD wd1 = LambdaTranslationTest2::pwD1;
203-
assertEquals("f1.000000 d2.000000", wd1.m(1.0f, 2.0));
203+
assertEquals(String.format("f%f d%f", 1.0f, 2.0), wd1.m(1.0f, 2.0));
204204

205205
WidenI wi1 = LambdaTranslationTest2::pwI1;
206206
assertEquals("b1 s2 c3 i4", wi1.m((byte) 1, (short) 2, (char) 3, 4));
@@ -221,12 +221,16 @@ static String pu(byte a0, short a1, char a2, int a3, long a4, boolean a5, float
221221

222222
public void testUnboxing() {
223223
Unbox u = LambdaTranslationTest2::pu;
224-
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));
224+
String expected = String.format("b%d s%d c%c i%d j%d z%b f%f d%f",
225+
(byte)1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0);
226+
assertEquals(expected, u.m((byte)1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
225227
}
226228

227229
public void testBoxing() {
228230
Box b = LambdaTranslationTest2::pb;
229-
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));
231+
String expected = String.format("b%d s%d c%c i%d j%d z%b f%f d%f",
232+
(byte) 1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0);
233+
assertEquals(expected, b.m((byte) 1, (short) 2, 'A', 4, 5L, true, 6.0f, 7.0));
230234
}
231235

232236
static boolean cc(Object o) {

0 commit comments

Comments
 (0)
Please sign in to comment.