8359182: Use @requires instead of SkippedException for MaxPath.java

Reviewed-by: bpb, bchristi
This commit is contained in:
SendaoYan 2025-06-12 07:51:29 +00:00
parent d7aa349820
commit 5886ef728f

View File

@ -24,21 +24,14 @@
/* @test /* @test
@bug 6481955 @bug 6481955
@summary Path length less than MAX_PATH (260) works on Windows @summary Path length less than MAX_PATH (260) works on Windows
@library /test/lib @requires (os.family == "windows")
*/ */
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import jtreg.SkippedException;
public class MaxPath { public class MaxPath {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String osName = System.getProperty("os.name");
if (!osName.startsWith("Windows")) {
throw new SkippedException("This test is run only on Windows");
}
int MAX_PATH = 260; int MAX_PATH = 260;
String dir = new File(".").getAbsolutePath() + "\\"; String dir = new File(".").getAbsolutePath() + "\\";
String padding = "1234567890123456789012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890"; String padding = "1234567890123456789012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890";