Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.lang.ref.ReferenceQueue
import java.lang.ref.WeakReference
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.concurrent.thread
import kotlin.random.Random
import kotlin.reflect.KClass
import kotlin.time.Duration.Companion.seconds

Expand All @@ -41,7 +42,7 @@ internal class GarbageCollectionTestHelper {
thread {
val leak: ArrayList<ByteArray> = ArrayList()
do {
val arraySize = (Math.random() * 1000).toInt()
val arraySize = Random.nextInt(1000)
leak.add(ByteArray(arraySize))
System.gc()
} while (continueTriggeringGc.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.junit.runners.JUnit4
import org.mockito.ArgumentCaptor
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import kotlin.random.Random
import kotlin.test.assertFailsWith

@Suppress("DEPRECATION")
Expand Down Expand Up @@ -501,8 +502,8 @@ class ItemKeyedDataSourceTest {
Item(
names[it % 10],
it,
Math.random() * 1000,
(Math.random() * 200).toInt().toString() + " fake st."
Random.nextDouble(1000.0),
Random.nextInt(200).toString() + " fake st."
)
}.sortedWith(ITEM_COMPARATOR)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import kotlin.random.Random
import kotlin.test.assertFailsWith

@RunWith(JUnit4::class)
Expand Down Expand Up @@ -426,8 +427,8 @@ class PagingSourceTest {
Item(
names[it % 10],
it,
Math.random() * 1000,
(Math.random() * 200).toInt().toString() + " fake st."
Random.nextDouble(1000.0),
Random.nextInt(200).toString() + " fake st."
)
}.sortedWith(ITEM_COMPARATOR)

Expand Down