Skip to content

Commit b81c51d

Browse files
committed
Fixed wrong type in log message about generated test file
1 parent 1f892b9 commit b81c51d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

utbot-core/src/main/kotlin/org/utbot/common/FileUtil.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,16 @@ object FileUtil {
224224
}
225225

226226
// https://stackoverflow.com/a/68822715
227-
fun byteCountToDisplaySize(bytes: Long): String =
228-
when {
229-
bytes >= 1 shl 30 -> "%.1f GB".format(bytes / (1 shl 30))
230-
bytes >= 1 shl 20 -> "%.1f MB".format(bytes / (1 shl 20))
231-
bytes >= 1 shl 10 -> "%.0f kB".format(bytes / (1 shl 10))
232-
else -> "$bytes bytes"
227+
fun byteCountToDisplaySize(bytes: Long): String {
228+
val bytesInDouble = bytes.toDouble()
229+
230+
return when {
231+
bytesInDouble >= 1 shl 30 -> "%.1f GB".format(bytesInDouble / (1 shl 30))
232+
bytesInDouble >= 1 shl 20 -> "%.1f MB".format(bytesInDouble / (1 shl 20))
233+
bytesInDouble >= 1 shl 10 -> "%.0f kB".format(bytesInDouble / (1 shl 10))
234+
else -> "$bytesInDouble bytes"
233235
}
236+
}
234237
}
235238

236239
/**

0 commit comments

Comments
 (0)