Skip to content

Commit 0ec4648

Browse files
committed
Improve the Tox create-and-kill test
Now it makes sure that the Toxes it creates are killed before moving on to the next one.
1 parent 8cc7d44 commit 0ec4648

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

domain/src/androidTest/kotlin/tox/ToxTest.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import androidx.test.platform.app.InstrumentationRegistry
1010
import kotlin.test.Test
1111
import kotlin.time.Duration.Companion.milliseconds
1212
import kotlinx.coroutines.ExperimentalCoroutinesApi
13-
import kotlinx.coroutines.delay
14-
import kotlinx.coroutines.test.TestScope
1513
import kotlinx.coroutines.test.advanceTimeBy
1614
import kotlinx.coroutines.test.advanceUntilIdle
1715
import kotlinx.coroutines.test.runTest
@@ -44,15 +42,16 @@ class ToxTest {
4442

4543
repeat(10) {
4644
val tox = Tox(
47-
TestScope(),
45+
this,
4846
contactRepository,
4947
userRepository,
5048
FakeSaveManager(),
5149
FakeBootstrapNodeRegistry(),
5250
).apply { isBootstrapNeeded = false }
5351
tox.start(SaveOptions(null, false, ProxyType.None, "", 0), null, ToxEventListener(), ToxAvEventListener())
54-
delay(25)
52+
advanceTimeBy(25.milliseconds)
5553
tox.stop()
54+
advanceUntilIdle()
5655
}
5756
}
5857

0 commit comments

Comments
 (0)