Skip to content

Commit

Permalink
Improve the Tox create-and-kill test
Browse files Browse the repository at this point in the history
Now it makes sure that the Toxes it creates are killed before moving on
to the next one.
  • Loading branch information
robinlinden committed Jan 9, 2025
1 parent 8cc7d44 commit 0ec4648
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions domain/src/androidTest/kotlin/tox/ToxTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import androidx.test.platform.app.InstrumentationRegistry
import kotlin.test.Test
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
Expand Down Expand Up @@ -44,15 +42,16 @@ class ToxTest {

repeat(10) {
val tox = Tox(
TestScope(),
this,
contactRepository,
userRepository,
FakeSaveManager(),
FakeBootstrapNodeRegistry(),
).apply { isBootstrapNeeded = false }
tox.start(SaveOptions(null, false, ProxyType.None, "", 0), null, ToxEventListener(), ToxAvEventListener())
delay(25)
advanceTimeBy(25.milliseconds)
tox.stop()
advanceUntilIdle()
}
}

Expand Down

0 comments on commit 0ec4648

Please sign in to comment.