diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index c729b96a48c..dd199a359e3 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -505,11 +505,6 @@ task runtime_random(type: RunKonanTest) { source = "runtime/basic/random.kt" } -task runtime_random_bound(type: RunKonanTest) { - disabled = (project.testTarget == 'wasm32') // Uses exceptions. - source = "runtime/basic/random_bound.kt" -} - task runtime_worker_random(type: RunKonanTest) { disabled = (project.testTarget == 'wasm32') // Uses workers. source = "runtime/basic/worker_random.kt" diff --git a/backend.native/tests/runtime/basic/random.kt b/backend.native/tests/runtime/basic/random.kt index 153d506b003..422d9f126b6 100644 --- a/backend.native/tests/runtime/basic/random.kt +++ b/backend.native/tests/runtime/basic/random.kt @@ -61,19 +61,3 @@ fun testNextInt() { testReproducibility(getTimeMillis(), { Random.nextInt(1000) }) testReproducibility(1000L, { Random.nextInt(1024) }) } - -@Test -fun testBoundsNextInt() { - boundTest(5000) - boundTest(32) - boundTest(2) - boundTest(Int.MAX_VALUE) -} - -private fun boundTest(bound: Int) { - val a = Array(100, { Random.nextInt(bound) }) - a.forEach { - assertTrue(it >= 0, "Should be: $it >= 0") - assertTrue(it < bound, "Should be: $it < $bound") - } -} diff --git a/backend.native/tests/runtime/basic/random_bound.kt b/backend.native/tests/runtime/basic/random_bound.kt deleted file mode 100644 index 38498a4a716..00000000000 --- a/backend.native/tests/runtime/basic/random_bound.kt +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. - */ - -package runtime.basic.random_bound - -import kotlin.random.* -import kotlin.test.* - -@Test -fun testBoundsNextInt() { - assertFailsWith("Should fail on bound 0", { Random.nextInt(0) }) - assertFailsWith("Should fail on bound -100", { Random.nextInt(-100) }) - assertFailsWith("Should fail on bound ${Int.MIN_VALUE}", { Random.nextInt(Int.MIN_VALUE) }) -} \ No newline at end of file