Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[**.{kt,kts,properties}]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ open class SequentialSemaphoreAsMutexBenchmark {

fun main() = SequentialSemaphoreAsMutexBenchmark().benchmark()

private val N = 1_000_000
private val N = 1_000_000
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ internal class NamedDispatcher(
override fun toString(): String {
return name
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ class CancellableContinuationTest : TestBase() {
}
assertEquals(1, i)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ class DispatchedContinuationTest : TestBase() {
yield() // to the launched job
finish(8)
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/test/FailedJobTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ class FailedJobTest : TestBase() {
assertTrue(!job.isActive)
assertTrue(job.isCancelled)
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/test/ImmediateYieldTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ class ImmediateYieldTest : TestBase() {
}
finish(2)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ class UnconfinedCancellationTest : TestBase() {
}.join()
finish(2)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ class AsFlowTest : TestBase() {

assertIsNot<SharedFlow<Int>>(flow)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ class BufferConflationTest : TestBase() {
buffer(8, onBufferOverflow = BufferOverflow.DROP_LATEST)
.buffer(3, BufferOverflow.DROP_OLDEST)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class ConflateTest : TestBase() {
assertEquals(listOf(1, 10, 20, 30), result)
finish(2)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class TransformTest : TestBase() {
}
assertEquals(listOf(1, 1, 2, 2, 3, 3), flow.toList())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ class TransformWhileTest : TestBase() {
private data class DownloadProgress(val percent: Int) {
fun isDone() = percent >= 100
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ class ShareInBufferTest : TestBase() {
checkBuffer(41) {
buffer(10).buffer(20).shareIn(it, SharingStarted.Eagerly, 11)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,4 @@ class SharedFlowScenarioTest : TestBase() {
println("--- That's it ---")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ class SharingStartedTest : TestBase() {
scope.cancel()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ class CollectLatestTest : TestBase() {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ class FirstTest : TestBase() {
expect(1)
job.cancel()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class SelectBiasTest : TestBase() {
assertTrue(counter[0] >= n / 4)
assertTrue(counter[1] >= n / 4)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ class SelectJobTest : TestBase() {
finish(4)
assertEquals("OK", res)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ class SelectMutexTest : TestBase() {
yield() // to the resumed select
finish(8)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class SelectUnlimitedChannelTest : TestBase() {
}
finish(3)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ internal actual class CommonThreadLocal<T> {
actual fun set(value: T) { this.value = value }
}

internal actual fun<T> commonThreadLocal(name: Symbol): CommonThreadLocal<T> = CommonThreadLocal()
internal actual fun<T> commonThreadLocal(name: Symbol): CommonThreadLocal<T> = CommonThreadLocal()
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/AwaitJvmTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class AwaitJvmTest : TestBase() {
}
finish(iterations + 1)
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/CoroutineScopeTestJvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ class MyMutableContextElement(
keyId,
"Merged '$value' and '${(overwritingElement as MyMutableContextElement).value}'"
)
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/CoroutinesJvmTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ class CoroutinesJvmTest : TestBase() {
}

private fun throwTestException(): Unit = throw TestException()
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/DebugThreadNameTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ class DebugThreadNameTest : TestBase() {
assertEquals(2, split.size, "Thread name '$name' is expected to contain one coroutine name")
assertEquals(expected, split[1], "Thread name '$name' is expected to end with coroutine name '$expected'")
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/DelayJvmTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ class DelayJvmTest : TestBase() {
pool.execute { cont.resumeWith(result) }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ class DispatchersToStringTest {
assertEquals("Named", named.toString())
}
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/EventLoopsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ class EventLoopsTest : TestBase() {
waitingThread.value = null
}
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/IODispatcherTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ class IODispatcherTest : TestBase() {
assertSame(mainThread, Thread.currentThread())
finish(4)
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/JobDisposeStressTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ class JobDisposeStressTest: TestBase() {

@Suppress("DEPRECATION_ERROR")
private class TestJob : JobSupport(active = true)
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/JobStressTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class JobStressTest : TestBase() {
var fireCount = 0
for (i in 0 until n) job.invokeOnCompletion { fireCount++ }.dispose()
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/TestBaseTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class TestBaseTest : TestBase() {
}

}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/WithDefaultContextTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class WithDefaultContextTest : TestBase() {
assertEquals("OK", result)
finish(4)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ class WithTimeoutChildDispatchStressTest : TestBase() {
assertEquals("DONE", result)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ class WithTimeoutOrNullThreadDispatchTest : TestBase() {
}
finish(6)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ class WithTimeoutThreadDispatchTest : TestBase() {
}
finish(7)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ class CancelledChannelLeakTest : TestBase() {
}

class X
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ class StackTraceRecoveryResumeModeTest : TestBase() {
yield()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ class StackTraceRecoveryWithTimeoutTest : TestBase() {
}
expectUnreached()
}
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/flow/FirstJvmTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class FirstJvmTest : TestBase() {
}.take(1).toList()
assertEquals(listOf(1), values)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ class OnCompletionInterceptedReleaseTest : TestBase() {
released++
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ class LockFreeTaskQueueStressTest(
println("T: produced=${produced.value}, consumed=${consumed.value}")
assertEquals(produced.value, consumed.value)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ class LockFreeTaskQueueTest(
}
assertTrue(q.isEmpty)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ class FlowDebounceTest : TestBase() {
assertEquals(listOf("A", "D", "E"), result)
finish(5)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ class WithTimeoutTest : TestBase() {
finish(3)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ internal class SCLockFreeTaskQueueWithRemoveLincheckTest : AbstractLockFreeTaskQ
@QuiescentConsistent
@Operation(nonParallelGroup = "consumer")
fun removeFirstOrNull() = q.removeFirstOrNull()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class ResizableAtomicArrayLincheckTest : AbstractLincheckTest() {
fun set(@Param(name = "index") index: Int, @Param(name = "value") value: Int) {
a.setSynchronized(index, value)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ class BlockingCoroutineDispatcherThreadLimitStressTest : SchedulerTestBase() {
tasks.awaitAll()
assertTrue(observedParallelism.max() <= CORES_COUNT, "Unexpected state: $observedParallelism")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ class SelectDeadlockStressTest : TestBase() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ class SelectMemoryLeakStressTest : TestBase() {

// capture big value for fast OOM in case of a bug
private fun bigValue(): ByteArray = ByteArray(4096)
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/wasmJs/src/Debug.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ internal external interface Console {
fun error(s: String)
}

internal external val console: Console
internal external val console: Console
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/wasmWasi/src/Debug.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ internal actual val Any.hexAddress: String

internal actual val Any.classSimpleName: String get() = this::class.simpleName ?: "Unknown"

internal actual inline fun assert(value: () -> Boolean) {}
internal actual inline fun assert(value: () -> Boolean) {}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ internal actual fun propagateExceptionFinalResort(exception: Throwable) {
val errorCode = printlnErrorStream("!!!")
val returnCode = if (errorCode != 0) errorCode else 1
wasiProcExit(returnCode)
}
}
2 changes: 1 addition & 1 deletion kotlinx-coroutines-debug/test/Example.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ fun main() = runBlocking {
DebugProbes.dumpCoroutines()
println("\nDumping only deferred")
DebugProbes.printJob(deferred)
}
}
Loading