summaryrefslogtreecommitdiffstats
path: root/jack-tests
diff options
context:
space:
mode:
authorBenoit Lamarche <benoitlamarche@google.com>2015-02-19 11:48:29 +0100
committerBenoit Lamarche <benoitlamarche@google.com>2015-02-19 11:48:29 +0100
commit502cb3096f46b94003d3e592e1980b7ccd247257 (patch)
treec331d2aadcbb8b461be9c3bd4701a46049d44889 /jack-tests
parentf92b40d4563830d4b26593a17eae961c02b6f6b7 (diff)
downloadtoolchain_jack-502cb3096f46b94003d3e592e1980b7ccd247257.zip
toolchain_jack-502cb3096f46b94003d3e592e1980b7ccd247257.tar.gz
toolchain_jack-502cb3096f46b94003d3e592e1980b7ccd247257.tar.bz2
Add failing obfuscation test with class repackaging
Bug: 19422723 Change-Id: I6f0fa01194f266a3a80ee6d13cafd2222e31e4b2
Diffstat (limited to 'jack-tests')
-rw-r--r--jack-tests/tests/com/android/jack/shrob/ObfuscationWithoutMappingTests.java6
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test043/info.txt3
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test043/jack/packa/ClassA1.java21
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test043/jack/packb/ClassA1.java21
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test043/proguard.flags0012
-rw-r--r--jack-tests/tests/com/android/jack/shrob/test043/refsObfuscationWithoutMapping/expected-001.txt4
6 files changed, 57 insertions, 0 deletions
diff --git a/jack-tests/tests/com/android/jack/shrob/ObfuscationWithoutMappingTests.java b/jack-tests/tests/com/android/jack/shrob/ObfuscationWithoutMappingTests.java
index a17b9fe..065decf 100644
--- a/jack-tests/tests/com/android/jack/shrob/ObfuscationWithoutMappingTests.java
+++ b/jack-tests/tests/com/android/jack/shrob/ObfuscationWithoutMappingTests.java
@@ -137,6 +137,12 @@ public class ObfuscationWithoutMappingTests extends AbstractTest {
super.test35_001();
}
+ @Test
+ @Category(KnownBugs.class)
+ public void test43_001() throws Exception {
+ runTest("043", "001", "");
+ }
+
// private void appendStringToFileCopy(File source, File dest, String appended) throws IOException {
// BufferedReader reader = null;
// BufferedWriter writer = null;
diff --git a/jack-tests/tests/com/android/jack/shrob/test043/info.txt b/jack-tests/tests/com/android/jack/shrob/test043/info.txt
new file mode 100644
index 0000000..996f0db
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test043/info.txt
@@ -0,0 +1,3 @@
+This test reproduces an issue when using obfuscation with the "-repackageclasses" flag and a
+specific package name. Its goal is to trigger a potential name conflict between renamed types that
+end up in the same package. \ No newline at end of file
diff --git a/jack-tests/tests/com/android/jack/shrob/test043/jack/packa/ClassA1.java b/jack-tests/tests/com/android/jack/shrob/test043/jack/packa/ClassA1.java
new file mode 100644
index 0000000..1671e03
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test043/jack/packa/ClassA1.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.jack.shrob.test043.jack.packa;
+
+public class ClassA1 {
+
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test043/jack/packb/ClassA1.java b/jack-tests/tests/com/android/jack/shrob/test043/jack/packb/ClassA1.java
new file mode 100644
index 0000000..20752b4
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test043/jack/packb/ClassA1.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.jack.shrob.test043.jack.packb;
+
+public class ClassA1 {
+
+}
diff --git a/jack-tests/tests/com/android/jack/shrob/test043/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test043/proguard.flags001
new file mode 100644
index 0000000..ad8d441
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test043/proguard.flags001
@@ -0,0 +1,2 @@
+-dontshrink
+-repackageclasses 'com.android.jack.shrob.test043.jack' \ No newline at end of file
diff --git a/jack-tests/tests/com/android/jack/shrob/test043/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test043/refsObfuscationWithoutMapping/expected-001.txt
new file mode 100644
index 0000000..8f11a51
--- /dev/null
+++ b/jack-tests/tests/com/android/jack/shrob/test043/refsObfuscationWithoutMapping/expected-001.txt
@@ -0,0 +1,4 @@
+com.android.jack.shrob.test043.jack.packb.ClassA1 -> com.android.jack.shrob.test043.jack.PynggN1:
+ void <init>() -> <init>
+com.android.jack.shrob.test043.jack.packa.ClassA1 -> com.android.jack.shrob.test043.jack.PynggN1:
+ void <init>() -> <init>