Refactor codegen tests

- initialize environment only once in setUp()
- add comments on why some tests are disabled
- modify and rename some tests
- re-enable now working tests
- extract some tests into files with box()
- remove useless 'throws' declarations and commented code
This commit is contained in:
Alexander Udalov
2013-01-22 22:22:53 +04:00
committed by Alexander Udalov
parent 99827d10a8
commit 0df71bd696
76 changed files with 601 additions and 704 deletions
@@ -12,12 +12,14 @@ class X {
fun test() {
for (i in C()) {
System.out.println(i)
foo(i)
}
}
}
fun foo(x: Int) {}
fun main(args: Array<String>) {
X().test()
}
}
@@ -12,12 +12,14 @@ class X {
fun test() {
for (i in C()) {
System.out.println(i)
foo(i)
}
}
}
fun foo(x: Int) {}
fun main(args: Array<String>) {
X().test()
}
}
@@ -12,12 +12,14 @@ class X {
fun test() {
for (i in C()) {
System.out.println(i)
foo(i)
}
}
}
fun foo(x: Int) {}
fun main(args: Array<String>) {
X().test()
}
}
@@ -9,7 +9,6 @@ fun box() : String {
for (el in b) {
sum = sum + (el ?: 0)
}
System.out?.println(sum)
if(sum != 10) return "b failed"
return "OK"
@@ -4,7 +4,6 @@ fun box() : String {
val processors = Runtime.getRuntime()!!.availableProcessors()
var threadNum = 1
while(threadNum <= 1024) {
System.out?.println(threadNum)
if(threadNum < 2 * processors)
threadNum += 1
else
@@ -34,9 +34,8 @@ fun box() : String {
a[2*i+1] = -2*i-1
}
a.quicksort()
for(i in 0..9) {
System.out?.print(a[i])
System.out?.print(' ')
for(i in 0..a.size-2) {
if (a[i] > a[i+1]) return "Fail $i: ${a[i]} > ${a[i+1]}"
}
return "OK"
}
}