mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-20 14:57:15 -04:00
[db] don't allow initial repos from fixtures to provide weight
The client was already auto-incrementing their weight anyway. But it leaked our internal weight handling into the library consumer which can cause issues like when me are making changes to how we handles repo weights as we are doing now.
This commit is contained in:
@@ -30,7 +30,6 @@ internal class RepositoryDaoTest : DbTest() {
|
||||
certificate = "abcdef", // not random, because format gets checked
|
||||
version = Random.nextLong(),
|
||||
enabled = Random.nextBoolean(),
|
||||
weight = Random.nextInt(),
|
||||
)
|
||||
val repoId = repoDao.insert(repo)
|
||||
|
||||
@@ -41,7 +40,7 @@ internal class RepositoryDaoTest : DbTest() {
|
||||
assertEquals(repo.certificate, actualRepo.certificate)
|
||||
assertEquals(repo.version, actualRepo.version)
|
||||
assertEquals(repo.enabled, actualRepo.enabled)
|
||||
assertEquals(repo.weight, actualRepo.weight)
|
||||
assertEquals(Int.MAX_VALUE - 2, actualRepo.weight) // ignoring provided weight
|
||||
assertEquals(-1, actualRepo.timestamp)
|
||||
assertEquals(3, actualRepo.mirrors.size)
|
||||
assertEquals(emptyList(), actualRepo.userMirrors)
|
||||
|
||||
Reference in New Issue
Block a user