()
| 271 | |
| 272 | |
| 273 | def test_float16_array_round_trip(): |
| 274 | fory = Fory(xlang=True, compatible=False, ref=False) |
| 275 | values = pyfory.Float16Array.from_values([0.0, 1.0, -2.0]) |
| 276 | typeinfo = fory.type_resolver.get_type_info(pyfory.Float16Array) |
| 277 | assert isinstance(typeinfo.serializer, fory_array_serializer_type(TypeId.FLOAT16_ARRAY)) |
| 278 | assert typeinfo.type_id == TypeId.FLOAT16_ARRAY |
| 279 | decoded = ser_de(fory, values) |
| 280 | assert isinstance(decoded, pyfory.Float16Array) |
| 281 | assert list(decoded.to_buffer()) == [0x0000, 0x3C00, 0xC000] |
| 282 | |
| 283 | |
| 284 | def test_float16_array_from_values(): |
nothing calls this directly
no test coverage detected