From 0105a8179cadb6a59535f7858e5ce8f7cbb9592d Mon Sep 17 00:00:00 2001 From: sanao Date: Fri, 8 Mar 2024 19:40:51 +0900 Subject: [PATCH] test: close DB in TimelineDaoTest (#512) The previous code forgot to close the DB after TimelineDaoTest was run, so a warning message was displayed when the test was run locally. Close the database using the `@After` annotation. Fixes #511 --- .../kotlin/app/pachli/core/database/dao/TimelineDaoTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/database/src/test/kotlin/app/pachli/core/database/dao/TimelineDaoTest.kt b/core/database/src/test/kotlin/app/pachli/core/database/dao/TimelineDaoTest.kt index 7cca8ad93..becbac32b 100644 --- a/core/database/src/test/kotlin/app/pachli/core/database/dao/TimelineDaoTest.kt +++ b/core/database/src/test/kotlin/app/pachli/core/database/dao/TimelineDaoTest.kt @@ -28,6 +28,7 @@ import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest import javax.inject.Inject import kotlinx.coroutines.runBlocking +import org.junit.After import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Rule @@ -51,6 +52,11 @@ class TimelineDaoTest { hilt.inject() } + @After + fun tearDown() { + db.close() + } + @Test fun insertGetStatus() = runBlocking { val setOne = makeStatus(statusId = 3)