[tests] Remove separate math test for wasm
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
* Copyright 2010-2018 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1650,20 +1650,16 @@ task extend_exception(type: RunKonanTest) {
|
||||
source = "runtime/exceptions/extend0.kt"
|
||||
}
|
||||
|
||||
// A special test variant for wasm without exception testing.
|
||||
// TODO: Remove when exceptions become available for wasm.
|
||||
task runtime_math_wasm(type: RunKonanTest) {
|
||||
disabled = (project.testTarget != 'wasm32')
|
||||
source = "runtime/math/wasm.kt"
|
||||
task runtime_math_exceptions(type: RunKonanTest) {
|
||||
disabled = (project.testTarget == 'wasm32')
|
||||
source = "stdlib_external/numbers/MathExceptionTest.kt"
|
||||
}
|
||||
|
||||
task runtime_math(type: RunKonanTest) {
|
||||
disabled = (project.testTarget == 'wasm32')
|
||||
source = "stdlib_external/numbers/MathTest.kt"
|
||||
}
|
||||
|
||||
task runtime_math_harmony(type: RunKonanTest) {
|
||||
disabled = (project.testTarget == 'wasm32')
|
||||
source = "stdlib_external/numbers/HarmonyMathTests.kt"
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package test.numbers
|
||||
|
||||
import kotlin.math.*
|
||||
import kotlin.test.*
|
||||
|
||||
class MathExceptionTest {
|
||||
|
||||
@Test fun exceptions() {
|
||||
assertFails { Double.NaN.roundToLong() }
|
||||
assertFails { Double.NaN.roundToInt() }
|
||||
|
||||
assertFails { Float.NaN.roundToLong() }
|
||||
assertFails { Float.NaN.roundToInt() }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -247,8 +247,6 @@ class DoubleMathTest {
|
||||
assertEquals(Long.MAX_VALUE, Double.POSITIVE_INFINITY.roundToLong())
|
||||
assertEquals(Long.MIN_VALUE, Double.NEGATIVE_INFINITY.roundToLong())
|
||||
|
||||
assertFails { Double.NaN.roundToLong() }
|
||||
|
||||
assertEquals(1, 1.0.roundToInt())
|
||||
assertEquals(1, 1.1.roundToInt())
|
||||
assertEquals(2, 1.5.roundToInt())
|
||||
@@ -260,8 +258,6 @@ class DoubleMathTest {
|
||||
assertEquals(Int.MIN_VALUE, (-Double.MAX_VALUE).roundToInt())
|
||||
assertEquals(Int.MAX_VALUE, Double.POSITIVE_INFINITY.roundToInt())
|
||||
assertEquals(Int.MIN_VALUE, Double.NEGATIVE_INFINITY.roundToInt())
|
||||
|
||||
assertFails { Double.NaN.roundToInt() }
|
||||
}
|
||||
|
||||
@Test fun absoluteValue() {
|
||||
@@ -642,8 +638,6 @@ class FloatMathTest {
|
||||
assertEquals(Long.MAX_VALUE, Float.POSITIVE_INFINITY.roundToLong())
|
||||
assertEquals(Long.MIN_VALUE, Float.NEGATIVE_INFINITY.roundToLong())
|
||||
|
||||
assertFails { Float.NaN.roundToLong() }
|
||||
|
||||
assertEquals(1, 1.0F.roundToInt())
|
||||
assertEquals(1, 1.1F.roundToInt())
|
||||
assertEquals(2, 1.5F.roundToInt())
|
||||
@@ -655,8 +649,6 @@ class FloatMathTest {
|
||||
assertEquals(Int.MIN_VALUE, (-Float.MAX_VALUE).roundToInt())
|
||||
assertEquals(Int.MAX_VALUE, Float.POSITIVE_INFINITY.roundToInt())
|
||||
assertEquals(Int.MIN_VALUE, Float.NEGATIVE_INFINITY.roundToInt())
|
||||
|
||||
assertFails { Float.NaN.roundToInt() }
|
||||
}
|
||||
|
||||
@Test fun absoluteValue() {
|
||||
@@ -784,7 +776,6 @@ class FloatMathTest {
|
||||
assertTrue(2.0f.IEEErem(0.0f).isNaN())
|
||||
assertEquals(PI.toFloat(), PI.toFloat().IEEErem(Float.NEGATIVE_INFINITY))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class IntegerMathTest {
|
||||
|
||||
Reference in New Issue
Block a user