You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value hierarchy tries to use most of the available serialization API and test it on all main data types available on Kotlin/JVM.
The exact implementation details are not important in most cases. We will highlight interesting implementation details whenever necessary.
1. Empty primitive arrays are not serialized
Empty primitive arrays are not present in any way in the encoded string.
Documentation does not specify behavior in that case.
The same exception can be achieved with null value fields, but that behavior is documented.
@OptIn(ExperimentalSerializationApi::class)
@Test
fun`missing field for empty primitive array`() {
val value:Value=BooleanArrayValue(booleanArrayOf())
val strMap =Properties.encodeToStringMap(value)
// Fails with// "kotlinx.serialization.MissingFieldException: Field 'value' is required for type with serial name 'org.plan.research.BooleanArrayValue', but it was missing"val decodedValue =Properties.decodeFromStringMap<Value>(strMap)
assertTrue { value == decodedValue }
}
Bugs are found by fuzzing team @ PLAN Lab
Environment
Kotlin version: 2.0.20
Library version: 1.7.3
Kotlin platforms: JVM
Gradle version: 8.8
The text was updated successfully, but these errors were encountered:
0. Setup
We created the following class hierarchy for testing serialization library:
Value
hierarchy tries to use most of the available serialization API and test it on all main data types available on Kotlin/JVM.The exact implementation details are not important in most cases. We will highlight interesting implementation details whenever necessary.
1. Empty primitive arrays are not serialized
Empty primitive arrays are not present in any way in the encoded string.
Documentation does not specify behavior in that case.
The same exception can be achieved with
null
value fields, but that behavior is documented.Bugs are found by fuzzing team @ PLAN Lab
Environment
The text was updated successfully, but these errors were encountered: