Skip to content

Commit e0cf38f

Browse files
committed
Get rid of unnecessary println in tests
1 parent f18a750 commit e0cf38f

File tree

10 files changed

+4
-27
lines changed

10 files changed

+4
-27
lines changed

benchmarks/src/jmh/kotlin/benchmarks/ForkJoinBenchmark.kt

+1-10
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,4 @@ private fun compute(coefficients: LongArray, start: Int, end: Int): Double {
154154
}
155155

156156
return result
157-
}
158-
159-
160-
fun main(args: Array<String>) {
161-
// Hand-rollled test
162-
val arr = LongArray(BATCH_SIZE * 8) { ThreadLocalRandom.current().nextLong(0, 100) }
163-
164-
println(ForkJoinPool.commonPool().submit(ForkJoinBenchmark.Task(arr, 0, arr.size)).join())
165-
println(ForkJoinBenchmark.RecursiveAction(arr, 0, arr.size).invoke())
166-
}
157+
}

binary-compatibility-validator/test/PublicApiTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ class PublicApiTest {
9999
val jarFile = getJarPath(base, jarPattern)
100100
val kotlinJvmMappingsFiles = listOf(base.resolve("../visibilities.json"))
101101

102-
println("Reading kotlin visibilities from $kotlinJvmMappingsFiles")
103102
val publicPackagePrefixes = publicPackages.map { it.replace('.', '/') + '/' }
104103
val visibilities =
105104
kotlinJvmMappingsFiles
106105
.map { readKotlinVisibilities(it).filterKeys { name -> publicPackagePrefixes.none { name.startsWith(it) } } }
107106
.reduce { m1, m2 -> m1 + m2 }
108107

109-
println("Reading binary API from $jarFile")
110108
val api = getBinaryAPI(JarFile(jarFile), visibilities).filterOutNonPublic(nonPublicPackages)
111109

112110
val target = File("reference-public-api")

common/kotlinx-coroutines-core-common/test/WithTimeoutOrNullTest.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ class WithTimeoutOrNullTest : TestBase() {
111111
}
112112
}
113113
assertEquals(null, result)
114-
// under load counter may be equal to 1, so the check is lenient here
115-
println("Executed: $counter times")
116-
check(counter in 1..2)
114+
check(counter in 1..2) {"Executed: $counter times"}
117115
}
118116

119117
@Test

core/kotlinx-coroutines-core/test/scheduling/CoroutineSchedulerStressTest.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ class CoroutineSchedulerStressTest : TestBase() {
9494
})
9595

9696
finishLatch.await()
97-
val n = observedThreads.size
98-
println("Observed $n threads with $AVAILABLE_PROCESSORS available processors")
99-
assertTrue(AVAILABLE_PROCESSORS in (n - 1)..n)
97+
val observed = observedThreads.size
98+
assertTrue(AVAILABLE_PROCESSORS in (observed - 1)..observed, "Observed $observed threads with $AVAILABLE_PROCESSORS available processors")
10099
validateResults()
101100
}
102101

core/kotlinx-coroutines-core/test/selects/SelectPhilosophersStressTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class SelectPhilosophersStressTest : TestBase() {
3838

3939
@Test
4040
fun testPhilosophers() = runBlocking<Unit> {
41-
println("--- SelectPhilosophersStressTest")
4241
val timeLimit = System.currentTimeMillis() + TEST_DURATION
4342
val philosophers = List<Deferred<Int>>(n) { id ->
4443
async {

core/kotlinx-coroutines-core/test/sync/MutexStressTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class MutexStressTest : TestBase() {
2424
}
2525
}
2626
jobs.forEach { it.join() }
27-
println("Shared value = $shared")
2827
assertEquals(n * k, shared)
2928
}
3029
}

native/kotlinx-coroutines-core-native/src/internal/CopyOnWriteList.kt

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ internal class CopyOnWriteList<E>(private var array: Array<Any?> = arrayOfNulls(
1111
override val size: Int get() = _size
1212

1313
override fun add(element: E): Boolean {
14-
println("Add")
1514
val newSize = if (_size == array.size) array.size * 2 else array.size
1615
val update = array.copyOf(newSize)
1716
update[_size++] = element

reactive/kotlinx-coroutines-reactor/test/SchedulerTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class SchedulerTest : TestBase() {
2424
val mainThread = Thread.currentThread()
2525
withContext(Schedulers.single().asCoroutineDispatcher()) {
2626
val t1 = Thread.currentThread()
27-
println(t1)
2827
assertThat(t1, IsNot(IsEqual(mainThread)))
2928
expect(2)
3029
delay(100)
3130
val t2 = Thread.currentThread()
32-
println(t2)
3331
assertThat(t2, IsNot(IsEqual(mainThread)))
3432
expect(3)
3533
}

reactive/kotlinx-coroutines-rx1/test/SchedulerTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class SchedulerTest : TestBase() {
2424
val mainThread = Thread.currentThread()
2525
withContext(Schedulers.io().asCoroutineDispatcher()) {
2626
val t1 = Thread.currentThread()
27-
println(t1)
2827
assertThat(t1, IsNot(IsEqual(mainThread)))
2928
expect(2)
3029
delay(100)
3130
val t2 = Thread.currentThread()
32-
println(t2)
3331
assertThat(t2, IsNot(IsEqual(mainThread)))
3432
expect(3)
3533
}

reactive/kotlinx-coroutines-rx2/test/SchedulerTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class SchedulerTest : TestBase() {
2424
val mainThread = Thread.currentThread()
2525
withContext(Schedulers.io().asCoroutineDispatcher()) {
2626
val t1 = Thread.currentThread()
27-
println(t1)
2827
assertThat(t1, IsNot(IsEqual(mainThread)))
2928
expect(2)
3029
delay(100)
3130
val t2 = Thread.currentThread()
32-
println(t2)
3331
assertThat(t2, IsNot(IsEqual(mainThread)))
3432
expect(3)
3533
}

0 commit comments

Comments
 (0)