From c0dc31422d6e7435ad7abdb547dedcc50b7fc0c3 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Mon, 28 Apr 2025 16:03:40 +0000 Subject: [PATCH] 8355558: SJIS.java test is always ignored Reviewed-by: bpb --- test/jdk/java/io/pathNames/win32/SJIS.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/io/pathNames/win32/SJIS.java b/test/jdk/java/io/pathNames/win32/SJIS.java index d1cad9dec9f..580f06330a6 100644 --- a/test/jdk/java/io/pathNames/win32/SJIS.java +++ b/test/jdk/java/io/pathNames/win32/SJIS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2025, 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 @@ -26,9 +26,15 @@ @summary Check that pathnames containing double-byte characters are not corrupted by win32 path processing @author Mark Reinhold + @library /test/lib */ -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import jtreg.SkippedException; public class SJIS { @@ -47,8 +53,11 @@ public class SJIS { /* This test is only valid on win32 systems that use the SJIS encoding */ if (File.separatorChar != '\\') return; - String enc = System.getProperty("file.encoding"); - if ((enc == null) || !enc.equals("SJIS")) return; + String enc = System.getProperty("native.encoding"); + if ((enc == null) || !enc.equals("MS932")) { + throw new SkippedException( + "native.encoding(%s) is not MS932".formatted(enc)); + } File f = new File("\u30BD"); if (f.exists()) rm(f);