[java] added unit test of do-while for AvoidArrayLoops
This commit is contained in:
1 parent
14b4a805d0
commit
204bbacbdc
1 file changed
+16
+16
@@ -48,6 +48,22 @@ public class Foo {
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>copy via do-while loop</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
public void bar() {
|
||||
int i = 0;
|
||||
do {
|
||||
a[i] = b[i];
|
||||
i++;
|
||||
} while (i < 10);
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>copy involving multiple arrays is ok</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
|
||||
Reference in new issue
Block a user