-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nbauma109
committed
Dec 14, 2022
1 parent
0fffa71
commit 5b75eb7
Showing
4 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package jd.core.test; | ||
/* | ||
* Test input built from Procyon's wiki page: | ||
* https://github.com/mstrobel/procyon/wiki/Decompiler-Output-Comparison. | ||
*/ | ||
public class ArrayCreation { | ||
public int[] arrayCreation(final boolean initialize) { | ||
if (initialize) { | ||
return new int[] { 1, 2, 3 }; | ||
} | ||
return new int[3]; | ||
} | ||
|
||
public int[][] jaggedArrayInitialization() { | ||
return new int[][] { { 1, 2, 3 }, { 4, 5, 6 } }; | ||
} | ||
|
||
public int[][] multiDimensionalArrayCreation() { | ||
return new int[3][2]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package jd.core.test; | ||
|
||
import org.apache.commons.io.IOUtils; | ||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class ArrayCreationTest extends AbstractTestCase { | ||
|
||
@Test | ||
public void test() throws IOException { | ||
String output = decompile("jd/core/test/ArrayCreation"); | ||
assertEquals(IOUtils.toString(getClass().getResource("ArrayCreation.txt"), StandardCharsets.UTF_8), output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* */ package jd.core.test; | ||
/* */ | ||
/* */ | ||
/* */ public class ArrayCreation | ||
/* */ { | ||
/* */ public int[] arrayCreation(boolean initialize) | ||
/* */ { | ||
/* 8 */ if (initialize) { | ||
/* 9 */ return new int[] { 1, 2, 3 }; | ||
/* */ } | ||
/* 11 */ return new int[3]; | ||
/* */ } | ||
/* */ | ||
/* */ public int[][] jaggedArrayInitialization() { | ||
/* 15 */ return new int[][] { { 1, 2, 3 }, { 4, 5, 6 } }; | ||
/* */ } | ||
/* */ | ||
/* */ public int[][] multiDimensionalArrayCreation() { | ||
/* 19 */ return new int[3][2]; | ||
/* */ } | ||
/* */ } |