Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/jdk/jdk/internal/loader/NativeLibraries/Main.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 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
Expand All @@ -24,13 +24,15 @@
/*
* @test
* @bug 8240975 8281335
* @library /test/lib
* @modules java.base/jdk.internal.loader
* @build java.base/* p.Test Main
* @run main/othervm/native -Xcheck:jni Main
* @summary Test loading and unloading of native libraries
*/

import jdk.internal.loader.NativeLibrariesTest;
import jdk.test.lib.Platform;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -55,7 +57,9 @@ public static void main(String... args) throws Exception {
test.unload();

// load zip library from JDK
test.load(System.mapLibraryName("zip"), true /* succeed */);
if (!Platform.isStatic()) {
test.load(System.mapLibraryName("zip"), true /* succeed */);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the other tests which also call NativeLibrariesTest.load(String, boolean), does the other tests also need this check !Platform.isStatic()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

// load non-existent library
test.load(System.mapLibraryName("NotExist"), false /* fail to load */);
Expand Down