srctree

Robin Linden parent 00508dd4 5934fe8e
Fix androidTest tests not compiling

inlinesplit
atox/src/androidTest/kotlin/IntegrationTest.kt added: 17, removed: 4, total 13
@@ -29,9 +29,9 @@ import javax.inject.Singleton
import ltd.evilcorp.atox.di.AndroidModule
import ltd.evilcorp.atox.di.AppComponent
import ltd.evilcorp.atox.di.AppModule
import ltd.evilcorp.atox.di.DaoModule
import ltd.evilcorp.atox.di.ViewModelModule
import ltd.evilcorp.core.db.Database
import ltd.evilcorp.core.di.DaoModule
import ltd.evilcorp.domain.tox.PublicKey
import ltd.evilcorp.domain.tox.SaveManager
import org.hamcrest.core.AllOf.allOf
 
domain/build.gradle.kts added: 17, removed: 4, total 13
@@ -96,5 +96,10 @@ dependencies {
testImplementation(Test.junit)
androidTestImplementation(AndroidX.Test.runner)
androidTestImplementation(AndroidX.Test.Ext.junit)
androidTestImplementation(Google.Guava.workaround)
androidTestImplementation(KotlinX.Coroutines.test) {
// Conflicts with a lot of things due to having embedded "byte buddy" instead of depending on it.A
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-debug")
}
androidTestImplementation(Test.mockk)
}
 
domain/src/androidTest/kotlin/tox/ToxTest.kt added: 17, removed: 4, total 13
@@ -7,15 +7,23 @@ package ltd.evilcorp.domain.tox
import androidx.test.ext.junit.runners.AndroidJUnit4
import io.mockk.mockk
import java.lang.Thread.sleep
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.TestCoroutineScope
import org.junit.Test
import org.junit.runner.RunWith
 
@RunWith(AndroidJUnit4::class)
class ToxTest {
@ExperimentalCoroutinesApi
@Test
fun quitting_does_not_crash() {
val dispatcher = TestCoroutineDispatcher()
val scope = TestCoroutineScope(dispatcher)
 
repeat(10) {
val tox = Tox(
scope,
mockk(relaxUnitFun = true),
mockk(relaxUnitFun = true),
mockk(relaxUnitFun = true),