[java] added unit test of do-while for AvoidArrayLoops

This commit is contained in:
Yasar Shaikh authored and GitHub committed 2022-10-09 22:23:37 +05:30
1 parent 14b4a805d0
commit 204bbacbdc
1 file changed
+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>