diff --git a/translator/src/test/kotlin/tests/kotlin/proto_repeated_varint.kt b/translator/src/test/kotlin/tests/kotlin/proto_repeated_varint.kt index 6c907abc3b9..2fab5f5435e 100644 --- a/translator/src/test/kotlin/tests/kotlin/proto_repeated_varint.kt +++ b/translator/src/test/kotlin/tests/kotlin/proto_repeated_varint.kt @@ -1134,14 +1134,15 @@ fun checkRepSerializationIdentity(msg: MessageRepeatedVarints): Int { } } + object Rng { var rngState = 0.6938893903907228 val point = 762939453125 fun rng(): Double { - val res = rngState - rngState.toInt().toDouble() rngState *= point.toDouble() - return res + rngState -= rngState.toLong().toDouble() + return rngState } } diff --git a/translator/src/test/kotlin/tests/kotlin/proto_repeated_zigzag.kt b/translator/src/test/kotlin/tests/kotlin/proto_repeated_zigzag.kt index dcea6007d0a..e2e4c72a44a 100644 --- a/translator/src/test/kotlin/tests/kotlin/proto_repeated_zigzag.kt +++ b/translator/src/test/kotlin/tests/kotlin/proto_repeated_zigzag.kt @@ -435,14 +435,15 @@ fun checkRepZZSerializationIdentity(msg: MessageRepeatedZigZag): Int { } } + object Rng { var rngState = 0.6938893903907228 val point = 762939453125 fun rng(): Double { - val res = rngState - rngState.toInt().toDouble() rngState *= point.toDouble() - return res + rngState -= rngState.toLong().toDouble() + return rngState } } @@ -544,3 +545,7 @@ fun testArraysOfDefaultValues(): Int { val msg = MessageRepeatedZigZag.BuilderMessageRepeatedZigZag(intArr, longArr).build() return checkRepZZSerializationIdentity(msg) } + +fun main(args: Array) { + println(testRepZigZag()) +} \ No newline at end of file