aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2016-07-14 12:09:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-07-14 12:09:05 +0000
commit1ec47ebb80125688ed7a0ead3e4be1b83bd03e0f (patch)
treeeedcabf67653439dd119c2a09fab67d0da31e139
parent9537193d98406746f08b2116b7d4a1c3518a867e (diff)
parent69496f90f9caa4fb88ce6e7a1bf1b5cbf94421b2 (diff)
downloadlibcore-n-iot-preview-2.tar.gz
Merge "OldSystemTest: Add test for System.load for non absolute paths."android-wear-7.1.1_r1android-n-preview-5android-n-iot-preview-2nougat-mr1-wear-releasen-iot-preview-2
-rw-r--r--luni/src/test/java/libcore/java/lang/OldSystemTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/lang/OldSystemTest.java b/luni/src/test/java/libcore/java/lang/OldSystemTest.java
index 6c12250eaf0..bffe8520b68 100644
--- a/luni/src/test/java/libcore/java/lang/OldSystemTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldSystemTest.java
@@ -330,6 +330,16 @@ public class OldSystemTest extends junit.framework.TestCase {
String libPath = (String) m.invoke(cl, "c");
assertNotNull(libPath);
System.load(new File(libPath).getAbsolutePath());
+
+ // A negative test for a library that exists but isn't specified as an absolute path.
+ // In other words, a name for which System.loadLibrary(libname) would suceed and
+ // System.load(libname) would fail.
+ String libName = new File(libPath).getName();
+ try {
+ System.load(libName);
+ fail();
+ } catch (UnsatisfiedLinkError expected) {
+ }
}
public void test_loadLibrary() {