* Fix test setup

* Fix tests

* Disable broken CloudflareTest

* Add a basic test for Android's Looper
This commit is contained in:
Constantin Piber
2026-05-18 20:04:39 +02:00
committed by GitHub
parent 762d5bdbe6
commit 779229a48a
11 changed files with 149 additions and 31 deletions

View File

@@ -7,12 +7,21 @@ package suwayomi.tachidesk.manga.model.dataclass
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import java.util.Objects
import kotlin.math.min
open class PaginatedList<T>(
val page: List<T>,
val hasNextPage: Boolean,
)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is PaginatedList<T>) return false
return page == other.page && hasNextPage == other.hasNextPage
}
override fun hashCode(): Int = Objects.hash(page, hasNextPage)
}
const val PAGINATION_FACTOR = 50

View File

@@ -22,7 +22,7 @@ import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.source.local.LocalSource
import io.github.config4k.toConfig
import io.github.oshai.kotlinlogging.KotlinLogging
import io.javalin.json.JavalinJackson
import io.javalin.json.JavalinJackson3
import io.javalin.json.JsonMapper
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
@@ -222,7 +222,7 @@ fun serverModule(applicationDirs: ApplicationDirs): Module =
module {
single { applicationDirs }
single<IUpdater> { Updater() }
single<JsonMapper> { JavalinJackson() }
single<JsonMapper> { JavalinJackson3() }
}
@OptIn(DelicateCoroutinesApi::class)

View File

@@ -144,14 +144,15 @@ object DBManager {
private val logger = KotlinLogging.logger {}
fun databaseUp() {
fun databaseUp(givenDb: Database? = null) {
val db =
try {
DBManager.setupDatabase()
} catch (e: Exception) {
logger.error(e) { "Failed to setup Database" }
return
}
givenDb
?: try {
DBManager.setupDatabase()
} catch (e: Exception) {
logger.error(e) { "Failed to setup Database" }
return
}
logger.info {
"Using ${db.vendor} database version ${db.version}"