diff options
| -rw-r--r-- | enigma/build.gradle | 2 | ||||
| -rw-r--r-- | enigma/src/test/java/cuchaz/enigma/TestAllowableClashes.java | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/enigma/build.gradle b/enigma/build.gradle index 8d081457..2c5d329f 100644 --- a/enigma/build.gradle +++ b/enigma/build.gradle | |||
| @@ -53,7 +53,7 @@ file('src/test/java/cuchaz/enigma/inputs').listFiles().each { theFile -> | |||
| 53 | 53 | ||
| 54 | args '@src/test/resources/proguard-test.conf', '-injars', file('build/test-inputs/' + | 54 | args '@src/test/resources/proguard-test.conf', '-injars', file('build/test-inputs/' + |
| 55 | "${theFile.name}.jar"), '-libraryjars', libraryJarsArg, | 55 | "${theFile.name}.jar"), '-libraryjars', libraryJarsArg, |
| 56 | '-outjars', file('build/test-obf/' + "${theFile.name}.jar"), '-printmapping', file("build/test-obf/${theFile.name}-mapping.txt") | 56 | '-outjars', file('build/test-obf/' + "${theFile.name}.jar"), '-printmapping', file("build/${theFile.name}-mapping.txt") |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | test.dependsOn "${theFile.name}TestObf" | 59 | test.dependsOn "${theFile.name}TestObf" |
diff --git a/enigma/src/test/java/cuchaz/enigma/TestAllowableClashes.java b/enigma/src/test/java/cuchaz/enigma/TestAllowableClashes.java index bfc21de3..ce82e380 100644 --- a/enigma/src/test/java/cuchaz/enigma/TestAllowableClashes.java +++ b/enigma/src/test/java/cuchaz/enigma/TestAllowableClashes.java | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | package cuchaz.enigma; | 1 | package cuchaz.enigma; |
| 2 | 2 | ||
| 3 | import java.io.IOException; | ||
| 4 | import java.nio.file.Paths; | ||
| 5 | |||
| 6 | import org.hamcrest.MatcherAssert; | ||
| 7 | import org.junit.Assert; | ||
| 8 | import org.junit.Test; | ||
| 9 | |||
| 3 | import cuchaz.enigma.classprovider.ClasspathClassProvider; | 10 | import cuchaz.enigma.classprovider.ClasspathClassProvider; |
| 4 | import cuchaz.enigma.translation.mapping.EntryMapping; | 11 | import cuchaz.enigma.translation.mapping.EntryMapping; |
| 5 | import cuchaz.enigma.translation.mapping.EntryRemapper; | 12 | import cuchaz.enigma.translation.mapping.EntryRemapper; |
| @@ -9,26 +16,18 @@ import cuchaz.enigma.translation.mapping.tree.EntryTree; | |||
| 9 | import cuchaz.enigma.translation.mapping.tree.EntryTreeNode; | 16 | import cuchaz.enigma.translation.mapping.tree.EntryTreeNode; |
| 10 | import cuchaz.enigma.translation.representation.entry.MethodEntry; | 17 | import cuchaz.enigma.translation.representation.entry.MethodEntry; |
| 11 | import cuchaz.enigma.utils.validation.ValidationContext; | 18 | import cuchaz.enigma.utils.validation.ValidationContext; |
| 12 | import org.hamcrest.MatcherAssert; | ||
| 13 | import org.junit.Assert; | ||
| 14 | import org.junit.Test; | ||
| 15 | |||
| 16 | import java.io.IOException; | ||
| 17 | import java.nio.file.Paths; | ||
| 18 | 19 | ||
| 19 | /** | 20 | /** |
| 20 | * Test that we can accept some name clashes that are allowed by javac | 21 | * Test that we can accept some name clashes that are allowed by javac |
| 21 | */ | 22 | */ |
| 22 | public class TestAllowableClashes { | 23 | public class TestAllowableClashes { |
| 23 | 24 | ||
| 24 | private static final String inputBaseName = "build/test-obf/visibility"; | ||
| 25 | |||
| 26 | @Test | 25 | @Test |
| 27 | public void test() throws IOException, MappingParseException { | 26 | public void test() throws IOException, MappingParseException { |
| 28 | //Load produced mappings | 27 | //Load produced mappings |
| 29 | Enigma enigma = Enigma.create(); | 28 | Enigma enigma = Enigma.create(); |
| 30 | EnigmaProject project = enigma.openJar(Paths.get(inputBaseName + ".jar"), new ClasspathClassProvider(), ProgressListener.none()); | 29 | EnigmaProject project = enigma.openJar(Paths.get("build/test-obf/visibility.jar"), new ClasspathClassProvider(), ProgressListener.none()); |
| 31 | EntryTree<EntryMapping> obfToDeobf = MappingFormat.PROGUARD.read(Paths.get(inputBaseName + "-mapping.txt"), ProgressListener.none(), null); | 30 | EntryTree<EntryMapping> obfToDeobf = MappingFormat.PROGUARD.read(Paths.get("build/visibility-mapping.txt"), ProgressListener.none(), null); |
| 32 | 31 | ||
| 33 | //Load them into enigma, none should conflict | 32 | //Load them into enigma, none should conflict |
| 34 | EntryRemapper mapper = project.getMapper(); | 33 | EntryRemapper mapper = project.getMapper(); |