diff options
| author | 2015-01-19 22:22:57 -0500 | |
|---|---|---|
| committer | 2015-01-19 22:22:57 -0500 | |
| commit | 2fbcf8e5c4eec0aa4a4fc59c7cc8abac33b1429c (patch) | |
| tree | 0e9c23d6838d3e0299831dbc24b6d736c268cd8b /test/cuchaz/enigma/TestJarIndexInheritanceTree.java | |
| parent | added inverse operation for moving classes out of the default package (diff) | |
| download | enigma-fork-2fbcf8e5c4eec0aa4a4fc59c7cc8abac33b1429c.tar.gz enigma-fork-2fbcf8e5c4eec0aa4a4fc59c7cc8abac33b1429c.tar.xz enigma-fork-2fbcf8e5c4eec0aa4a4fc59c7cc8abac33b1429c.zip | |
solved tricky issue with incorrect translation of fields/methods referenced by a subclass instead of the declaring class
Diffstat (limited to 'test/cuchaz/enigma/TestJarIndexInheritanceTree.java')
| -rw-r--r-- | test/cuchaz/enigma/TestJarIndexInheritanceTree.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/cuchaz/enigma/TestJarIndexInheritanceTree.java b/test/cuchaz/enigma/TestJarIndexInheritanceTree.java index caf6578..4d66397 100644 --- a/test/cuchaz/enigma/TestJarIndexInheritanceTree.java +++ b/test/cuchaz/enigma/TestJarIndexInheritanceTree.java | |||
| @@ -43,7 +43,7 @@ public class TestJarIndexInheritanceTree { | |||
| 43 | 43 | ||
| 44 | public TestJarIndexInheritanceTree() throws Exception { | 44 | public TestJarIndexInheritanceTree() throws Exception { |
| 45 | m_index = new JarIndex(); | 45 | m_index = new JarIndex(); |
| 46 | m_index.indexJar(new JarFile("build/libs/testInheritanceTree.obf.jar"), false); | 46 | m_index.indexJar(new JarFile("build/testInheritanceTree.obf.jar"), false); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | @Test | 49 | @Test |
| @@ -63,27 +63,27 @@ public class TestJarIndexInheritanceTree { | |||
| 63 | TranslationIndex index = m_index.getTranslationIndex(); | 63 | TranslationIndex index = m_index.getTranslationIndex(); |
| 64 | 64 | ||
| 65 | // base class | 65 | // base class |
| 66 | assertThat(index.getSuperclassName(m_baseClass.getName()), is(nullValue())); | 66 | assertThat(index.getSuperclass(m_baseClass), is(nullValue())); |
| 67 | assertThat(index.getAncestry(m_baseClass.getName()), is(empty())); | 67 | assertThat(index.getAncestry(m_baseClass), is(empty())); |
| 68 | assertThat(index.getSubclassNames(m_baseClass.getName()), containsInAnyOrder( | 68 | assertThat(index.getSubclass(m_baseClass), containsInAnyOrder( |
| 69 | m_subClassA.getName(), | 69 | m_subClassA, |
| 70 | m_subClassB.getName() | 70 | m_subClassB |
| 71 | )); | 71 | )); |
| 72 | 72 | ||
| 73 | // subclass a | 73 | // subclass a |
| 74 | assertThat(index.getSuperclassName(m_subClassA.getName()), is(m_baseClass.getName())); | 74 | assertThat(index.getSuperclass(m_subClassA), is(m_baseClass)); |
| 75 | assertThat(index.getAncestry(m_subClassA.getName()), contains(m_baseClass.getName())); | 75 | assertThat(index.getAncestry(m_subClassA), contains(m_baseClass)); |
| 76 | assertThat(index.getSubclassNames(m_subClassA.getName()), contains(m_subClassAA.getName())); | 76 | assertThat(index.getSubclass(m_subClassA), contains(m_subClassAA)); |
| 77 | 77 | ||
| 78 | // subclass aa | 78 | // subclass aa |
| 79 | assertThat(index.getSuperclassName(m_subClassAA.getName()), is(m_subClassA.getName())); | 79 | assertThat(index.getSuperclass(m_subClassAA), is(m_subClassA)); |
| 80 | assertThat(index.getAncestry(m_subClassAA.getName()), contains(m_subClassA.getName(), m_baseClass.getName())); | 80 | assertThat(index.getAncestry(m_subClassAA), contains(m_subClassA, m_baseClass)); |
| 81 | assertThat(index.getSubclassNames(m_subClassAA.getName()), is(empty())); | 81 | assertThat(index.getSubclass(m_subClassAA), is(empty())); |
| 82 | 82 | ||
| 83 | // subclass b | 83 | // subclass b |
| 84 | assertThat(index.getSuperclassName(m_subClassB.getName()), is(m_baseClass.getName())); | 84 | assertThat(index.getSuperclass(m_subClassB), is(m_baseClass)); |
| 85 | assertThat(index.getAncestry(m_subClassB.getName()), contains(m_baseClass.getName())); | 85 | assertThat(index.getAncestry(m_subClassB), contains(m_baseClass)); |
| 86 | assertThat(index.getSubclassNames(m_subClassB.getName()), is(empty())); | 86 | assertThat(index.getSubclass(m_subClassB), is(empty())); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | @Test | 89 | @Test |