8271615: vmTestbase/vm/jit/LongTransitions/ test fail due to locale mismatch

Reviewed-by: shade, lmesnik
This commit is contained in:
Mikhailo Seledtsov 2022-08-26 18:16:16 +00:00
parent 9a0d1e7ce8
commit 774edeb521

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, 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
@ -6218,6 +6218,14 @@ public class LTTest
fisJava.read(javaData);
for ( int cnt=0;cnt<byteCount;++cnt)
{
// Special handling for a decimal point.
// Decimal point differs based on locale, could be '.' or ','.
// Due to settings on a test host environment locale may differ between
// the native side vs Java side thus causing mismatch and test failure.
if ((cData[cnt] == '.' || cData[cnt] == ',') &&
(javaData[cnt] == '.' || javaData[cnt] == ',')) {
continue;
}
if ( cData[cnt]!=javaData[cnt] )
{
System.out.println("FAIL:Test failed! "+cnt+" byte are wrong! C file - " + cData[cnt] + " Java file - "+javaData[cnt] );