From 2fbcf8e5c4eec0aa4a4fc59c7cc8abac33b1429c Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 19 Jan 2015 22:22:57 -0500 Subject: solved tricky issue with incorrect translation of fields/methods referenced by a subclass instead of the declaring class --- test/cuchaz/enigma/TestJarIndexLoneClass.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'test/cuchaz/enigma/TestJarIndexLoneClass.java') diff --git a/test/cuchaz/enigma/TestJarIndexLoneClass.java b/test/cuchaz/enigma/TestJarIndexLoneClass.java index 0575eec..a061b72 100644 --- a/test/cuchaz/enigma/TestJarIndexLoneClass.java +++ b/test/cuchaz/enigma/TestJarIndexLoneClass.java @@ -29,6 +29,7 @@ import cuchaz.enigma.analysis.JarIndex; import cuchaz.enigma.analysis.MethodImplementationsTreeNode; import cuchaz.enigma.analysis.MethodInheritanceTreeNode; import cuchaz.enigma.mapping.BehaviorEntry; +import cuchaz.enigma.mapping.ClassEntry; import cuchaz.enigma.mapping.FieldEntry; import cuchaz.enigma.mapping.MethodEntry; import cuchaz.enigma.mapping.Translator; @@ -39,7 +40,7 @@ public class TestJarIndexLoneClass { public TestJarIndexLoneClass() throws Exception { m_index = new JarIndex(); - m_index.indexJar(new JarFile("build/libs/testLoneClass.obf.jar"), false); + m_index.indexJar(new JarFile("build/testLoneClass.obf.jar"), false); } @Test @@ -52,12 +53,12 @@ public class TestJarIndexLoneClass { @Test public void translationIndex() { - assertThat(m_index.getTranslationIndex().getSuperclassName("none/a"), is(nullValue())); - assertThat(m_index.getTranslationIndex().getSuperclassName("cuchaz/enigma/inputs/Keep"), is(nullValue())); - assertThat(m_index.getTranslationIndex().getAncestry("none/a"), is(empty())); - assertThat(m_index.getTranslationIndex().getAncestry("cuchaz/enigma/inputs/Keep"), is(empty())); - assertThat(m_index.getTranslationIndex().getSubclassNames("none/a"), is(empty())); - assertThat(m_index.getTranslationIndex().getSubclassNames("cuchaz/enigma/inputs/Keep"), is(empty())); + assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("none/a")), is(nullValue())); + assertThat(m_index.getTranslationIndex().getSuperclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(nullValue())); + assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("none/a")), is(empty())); + assertThat(m_index.getTranslationIndex().getAncestry(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(empty())); + assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("none/a")), is(empty())); + assertThat(m_index.getTranslationIndex().getSubclass(new ClassEntry("cuchaz/enigma/inputs/Keep")), is(empty())); } @Test -- cgit v1.2.3