Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
01dfae4a
Commit
01dfae4a
authored
Apr 12, 2019
by
Ahmed Ashour
Committed by
skylot
Apr 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add test case for anonymous type, and move assertions to NYI (PR #589)
parent
395cae43
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
6 deletions
+38
-6
TestAnonymousClass13.java
...va/jadx/tests/integration/inner/TestAnonymousClass13.java
+23
-0
TestAnonymousClass2.java
...ava/jadx/tests/integration/inner/TestAnonymousClass2.java
+2
-3
TestAnonymousClass3.java
...ava/jadx/tests/integration/inner/TestAnonymousClass3.java
+13
-3
No files found.
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass13.java
0 → 100644
View file @
01dfae4a
package
jadx
.
tests
.
integration
.
inner
;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.tests.api.IntegrationTest
;
public
class
TestAnonymousClass13
extends
IntegrationTest
{
public
static
class
TestCls
{
public
void
test
()
{
new
TestCls
()
{
};
}
}
@Test
@NotYetImplemented
public
void
test
()
{
getClassNode
(
TestCls
.
class
);
}
}
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass2.java
View file @
01dfae4a
...
...
@@ -33,7 +33,7 @@ public class TestAnonymousClass2 extends IntegrationTest {
}
};
}
/*
public
Runnable
test3
()
{
final
int
i
=
f
+
2
;
return
new
Runnable
()
{
...
...
@@ -43,7 +43,6 @@ public class TestAnonymousClass2 extends IntegrationTest {
}
};
}
*/
}
}
...
...
@@ -55,7 +54,7 @@ public class TestAnonymousClass2 extends IntegrationTest {
assertThat
(
code
,
not
(
containsString
(
"synthetic"
)));
assertThat
(
code
,
not
(
containsString
(
"AnonymousClass_"
)));
assertThat
(
code
,
containsString
(
"f = 1;"
));
//
assertThat(code, containsString("f = i;"));
assertThat
(
code
,
containsString
(
"f = i;"
));
assertThat
(
code
,
not
(
containsString
(
"Inner obj = ;"
)));
assertThat
(
code
,
containsString
(
"Inner.this;"
));
}
...
...
jadx-core/src/test/java/jadx/tests/integration/inner/TestAnonymousClass3.java
View file @
01dfae4a
...
...
@@ -2,11 +2,13 @@ package jadx.tests.integration.inner;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.
not
;
public
class
TestAnonymousClass3
extends
IntegrationTest
{
...
...
@@ -47,9 +49,17 @@ public class TestAnonymousClass3 extends IntegrationTest {
assertThat
(
code
,
containsString
(
indent
(
4
)
+
"public void run() {"
));
assertThat
(
code
,
containsString
(
indent
(
3
)
+
"}.start();"
));
// assertThat(code, not(containsString("synthetic")));
// assertThat(code, not(containsString("AnonymousClass_")));
assertThat
(
code
,
not
(
containsString
(
"AnonymousClass_"
)));
}
@Test
@NotYetImplemented
public
void
test2
()
{
disableCompilation
();
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
// assertThat(code, containsString("a = f--;"));
assertThat
(
code
,
not
(
containsString
(
"synthetic"
)));
assertThat
(
code
,
containsString
(
"a = f--;"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment