Skip to content

Commit

Permalink
Fix tets that need a 8-length remote ID
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
  • Loading branch information
AlvaroBrey committed Jan 9, 2023
1 parent 97c7ee7 commit 08077bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void testSaveNewFile() {
targetContext).execute(client).isSuccess());

OCFile newFile = new OCFile("/1/1/1.txt");
newFile.setRemoteId("123");
newFile.setRemoteId("12345678");

sut.saveNewFile(newFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class GalleryFragmentIT : AbstractIT() {
fun before() {
activity = testActivityRule.launchActivity(null)

createImage(1, true, 700, 300)
createImage(2, true, 500, 300)
createImage(10000001, true, 700, 300)
createImage(10000002, true, 500, 300)

createImage(7, true, 300, 400)
createImage(10000007, true, 300, 400)
}

@After
Expand All @@ -73,14 +73,14 @@ class GalleryFragmentIT : AbstractIT() {
longSleep()
}

private fun createImage(int: Int, createPreview: Boolean = true, width: Int? = null, height: Int? = null) {
private fun createImage(id: Int, createPreview: Boolean = true, width: Int? = null, height: Int? = null) {
val defaultSize = ThumbnailsCacheManager.getThumbnailDimension().toFloat()
val file = OCFile("/$int.png").apply {
fileId = int.toLong()
remoteId = "$int"
val file = OCFile("/$id.png").apply {
fileId = id.toLong()
remoteId = "$id"
mimeType = "image/png"
isPreviewAvailable = true
modificationTimestamp = (1658475504 + int.toLong()) * 1000
modificationTimestamp = (1658475504 + id.toLong()) * 1000
imageDimension = ImageDimension(width?.toFloat() ?: defaultSize, height?.toFloat() ?: defaultSize)
storageManager.saveFile(this)
}
Expand Down Expand Up @@ -116,6 +116,6 @@ class GalleryFragmentIT : AbstractIT() {

assertNotNull(ThumbnailsCacheManager.getBitmapFromDiskCache(PREFIX_RESIZED_IMAGE + file.remoteId))

Log_OC.d("Gallery_thumbnail", "created $int with ${bitmap.width} x ${bitmap.height}")
Log_OC.d("Gallery_thumbnail", "created $id with ${bitmap.width} x ${bitmap.height}")
}
}

0 comments on commit 08077bd

Please sign in to comment.