Skip to content

Commit 4f9c6fb

Browse files
committed
8355558: SJIS.java test is always ignored
Backport-of: c0dc31422d6e7435ad7abdb547dedcc50b7fc0c3
1 parent ca1d705 commit 4f9c6fb

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/jdk/java/io/pathNames/win32/SJIS.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2025, 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
@@ -26,9 +26,15 @@
2626
@summary Check that pathnames containing double-byte characters are not
2727
corrupted by win32 path processing
2828
@author Mark Reinhold
29+
@library /test/lib
2930
*/
3031

31-
import java.io.*;
32+
import java.io.File;
33+
import java.io.FileOutputStream;
34+
import java.io.IOException;
35+
import java.io.OutputStream;
36+
37+
import jtreg.SkippedException;
3238

3339

3440
public class SJIS {
@@ -47,8 +53,11 @@ public static void main(String[] args) throws Exception {
4753
/* This test is only valid on win32 systems
4854
that use the SJIS encoding */
4955
if (File.separatorChar != '\\') return;
50-
String enc = System.getProperty("file.encoding");
51-
if ((enc == null) || !enc.equals("SJIS")) return;
56+
String enc = System.getProperty("native.encoding");
57+
if ((enc == null) || !enc.equals("MS932")) {
58+
throw new SkippedException(
59+
"native.encoding(%s) is not MS932".formatted(enc));
60+
}
5261

5362
File f = new File("\u30BD");
5463
if (f.exists()) rm(f);

0 commit comments

Comments
 (0)