Parcelize: Fix test code
On Android, we would need to call `setDataPosition(0)` after unmarshalling a parcel. The reason why the test code is currently working is purely because the Robolectric test framework is more permissive.
This commit is contained in:
committed by
Yan Zhulanow
parent
d93e5d3dc0
commit
9b7a95b05c
Vendored
+1
@@ -17,6 +17,7 @@ fun box() = parcelTest { parcel ->
|
||||
|
||||
val bytes = parcel.marshall()
|
||||
parcel.unmarshall(bytes, 0, bytes.size)
|
||||
parcel.setDataPosition(0)
|
||||
|
||||
val test2 = readFromParcel<User>(parcel)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user