j2k: flatten test cases and testData directory structure

Move j2k/test/tests -> j2k/tests, j2k/test/testData -> j2k/testData
This commit is contained in:
Alexander Udalov
2015-01-03 00:49:40 +03:00
parent ed2f123b54
commit 3c859caf2b
1137 changed files with 1417 additions and 1412 deletions
@@ -0,0 +1,12 @@
//file
import java.io.*;
public class C {
void foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
System.out.println(c);
}
}
}
@@ -0,0 +1,12 @@
import java.io.*
public class C {
throws(javaClass<IOException>())
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
System.out.println(c)
}
}
}
@@ -0,0 +1,12 @@
//file
import java.io.*;
public class C {
void foo() throws IOException {
try(ByteArrayInputStream input = new ByteArrayInputStream(new byte[10]);
OutputStream output = new ByteArrayOutputStream()) {
output.write(input.read());
output.write(0);
}
}
}
@@ -0,0 +1,13 @@
import java.io.*
public class C {
throws(javaClass<IOException>())
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { input ->
ByteArrayOutputStream().use { output ->
output.write(input.read())
output.write(0)
}
}
}
}
@@ -0,0 +1,10 @@
//file
import java.io.*;
public class C {
void foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
System.out.println(stream.read());
}
}
}
@@ -0,0 +1,8 @@
import java.io.*
public class C {
throws(javaClass<IOException>())
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream -> System.out.println(stream.read()) }
}
}
@@ -0,0 +1,15 @@
//file
import java.io.*;
public class C {
void foo() {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
System.out.println(c);
}
catch (IOException e) {
System.out.println(e);
}
}
}
@@ -0,0 +1,16 @@
import java.io.*
public class C {
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
System.out.println(c)
}
} catch (e: IOException) {
System.out.println(e)
}
}
}
@@ -0,0 +1,18 @@
//file
import java.io.*;
public class C {
void foo() {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
System.out.println(c);
}
catch (IOException e) {
System.out.println(e);
}
finally {
System.out.println("Finally!");
}
}
}
@@ -0,0 +1,17 @@
import java.io.*
public class C {
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
System.out.println(c)
}
} catch (e: IOException) {
System.out.println(e)
} finally {
System.out.println("Finally!")
}
}
}
@@ -0,0 +1,18 @@
//file
import java.io.*;
public class C {
void foo() {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
System.out.println(c);
}
catch (IOException e) {
System.out.println(e);
}
catch (Exception e) {
System.err.println(e);
}
}
}
@@ -0,0 +1,18 @@
import java.io.*
public class C {
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
System.out.println(c)
}
} catch (e: IOException) {
System.out.println(e)
} catch (e: Exception) {
System.err.println(e)
}
}
}
@@ -0,0 +1,15 @@
//file
import java.io.*;
public class C {
void foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
System.out.println(c);
}
finally {
// dispose something else
}
}
}
@@ -0,0 +1,16 @@
import java.io.*
public class C {
throws(javaClass<IOException>())
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
System.out.println(c)
}
} finally {
// dispose something else
}
}
}
@@ -0,0 +1,16 @@
//file
import java.io.*;
public class C {
int foo() {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
// reading something
int c = stream.read();
return c;
}
catch (IOException e) {
System.out.println(e);
return -1;
}
}
}
@@ -0,0 +1,17 @@
import java.io.*
public class C {
fun foo(): Int {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
val c = stream.read()
return c
}
} catch (e: IOException) {
System.out.println(e)
return -1
}
}
}
@@ -0,0 +1,23 @@
//file
import java.io.*;
interface I {
int doIt(InputStream stream) throws IOException;
}
public class C {
void foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
bar(new I() {
@Override
public int doIt(InputStream stream) throws IOException {
return stream.available();
}
}, stream);
}
}
int bar(I i, InputStream stream) throws IOException {
return i.doIt(stream);
}
}
@@ -0,0 +1,25 @@
import java.io.*
trait I {
throws(javaClass<IOException>())
public fun doIt(stream: InputStream): Int
}
public class C {
throws(javaClass<IOException>())
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
bar(object : I {
throws(javaClass<IOException>())
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
}
}
throws(javaClass<IOException>())
fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}
}
@@ -0,0 +1,23 @@
//file
import java.io.*;
interface I {
int doIt(InputStream stream) throws IOException;
}
public class C {
int foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
return bar(new I() {
@Override
public int doIt(InputStream stream) throws IOException {
return stream.available();
}
}, stream);
}
}
int bar(I i, InputStream stream) throws IOException {
return i.doIt(stream);
}
}
@@ -0,0 +1,25 @@
import java.io.*
trait I {
throws(javaClass<IOException>())
public fun doIt(stream: InputStream): Int
}
public class C {
throws(javaClass<IOException>())
fun foo(): Int {
ByteArrayInputStream(ByteArray(10)).use { stream ->
return bar(object : I {
throws(javaClass<IOException>())
override fun doIt(stream: InputStream): Int {
return stream.available()
}
}, stream)
}
}
throws(javaClass<IOException>())
fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}
}
@@ -0,0 +1,26 @@
//file
import java.io.*;
interface I {
int doIt(InputStream stream) throws IOException;
}
public class C {
int foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
if (stream.read() >= 0) {
return bar(new I() {
@Override
public int doIt(InputStream stream) throws IOException {
return stream.available();
}
}, stream);
}
}
return -1;
}
int bar(I i, InputStream stream) throws IOException {
return i.doIt(stream);
}
}