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
ef28875a
Commit
ef28875a
authored
Apr 09, 2019
by
Ahmed Ashour
Committed by
skylot
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add test case for #43 (PR #576)
parent
10fb57f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
TestBreakInLoop3.java
...t/java/jadx/tests/integration/loops/TestBreakInLoop3.java
+61
-0
No files found.
jadx-core/src/test/java/jadx/tests/integration/loops/TestBreakInLoop3.java
0 → 100644
View file @
ef28875a
package
jadx
.
tests
.
integration
.
loops
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
org.junit.jupiter.api.Test
;
import
jadx.NotYetImplemented
;
import
jadx.tests.api.IntegrationTest
;
public
class
TestBreakInLoop3
extends
IntegrationTest
{
public
static
class
TestCls
{
private
StringBuilder
builder
=
new
StringBuilder
();
public
void
writeMore
(
String
fid
)
{
boolean
tryMkdir
=
true
;
File
ff
=
new
File
(
fid
);
while
(
true
)
{
prt
(
"1"
);
try
{
new
FileOutputStream
(
fid
).
close
();
}
catch
(
Exception
ex
)
{
if
(
tryMkdir
)
{
// On first error, try creating the base dirs.
tryMkdir
=
false
;
prt
(
"2"
);
continue
;
}
prt
(
"3"
);
if
(
ff
.
exists
())
{
prt
(
"4"
);
}
else
{
prt
(
"5"
);
}
prt
(
"6"
);
}
prt
(
"7"
);
break
;
}
// end of while true, loop to allow retry of fos.write after mkdir
prt
(
"8"
);
}
// end of writeMore
private
void
prt
(
String
s
)
{
builder
.
append
(
s
);
}
public
void
check
()
{
writeMore
(
""
);
assertEquals
(
"12135678"
,
builder
.
toString
());
}
}
@Test
@NotYetImplemented
public
void
test43
()
throws
Exception
{
getClassNode
(
TestCls
.
class
);
}
}
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