Gross stdlib cleanup (part 3). (#1929)

This commit is contained in:
Nikolay Igotti
2018-08-24 18:46:00 +03:00
committed by GitHub
parent a52dd55d42
commit cbc404324c
48 changed files with 280 additions and 497 deletions
-2
View File
@@ -1452,8 +1452,6 @@ task array3(type: RunKonanTest) {
}
task typed_array0(type: RunKonanTest) {
// MIPS target is big-endian.
disabled = (project.testTarget == 'linux_mips32')
goldValue = "OK\n"
source = "runtime/collections/typed_array0.kt"
}
@@ -27,7 +27,7 @@ class AllCodePointsTest {
fun codePointToString(codePoint: Int): String {
val charArray = Char.toChars(codePoint)
return fromCharArray(charArray, 0, charArray.size)
return String(charArray, 0, charArray.size)
}
// TODO: Here is a performance problem: an execution of this test requires much more time than it in Kotlin/JVM.
@@ -15,12 +15,12 @@ open class Base {
open fun fooParam(arg0: String, arg1: Int) = println("Base.fooParam: $arg0 $arg1")
@CName(fullName = "", shortName = "strangeName") fun странноеИмя() = 111
@CName(externName = "", shortName = "strangeName") fun странноеИмя() = 111
}
// Top level functions.
@CName(fullName = "topLevelFunctionFromC", shortName = "topLevelFunctionFromCShort")
@CName(externName = "topLevelFunctionFromC", shortName = "topLevelFunctionFromCShort")
fun topLevelFunction(x1: Int, x2: Int) = x1 - x2
@CName("topLevelFunctionVoidFromC")
+1 -2
View File
@@ -17,6 +17,5 @@ import kotlin.test.*
a[2] = 'l'
a[3] = 'l'
a[4] = 'o'
// Note that it uses private Konan API.
println("Hello".hashCode() == fromCharArray(a, 0, 5).hashCode())
println("Hello".hashCode() == String(a, 0, 5).hashCode())
}
@@ -10,5 +10,5 @@ import kotlin.test.*
print(" ")
}
println()
println(fromCharArray(array, 0, array.size))
println(String(array, 0, array.size))
}