()
| 313 | |
| 314 | |
| 315 | def test_bfloat16_array_round_trip(): |
| 316 | fory = Fory(xlang=True, compatible=False, ref=False) |
| 317 | values = pyfory.BFloat16Array.from_values([0.0, 1.0, -2.0]) |
| 318 | typeinfo = fory.type_resolver.get_type_info(pyfory.BFloat16Array) |
| 319 | assert isinstance(typeinfo.serializer, fory_array_serializer_type(TypeId.BFLOAT16_ARRAY)) |
| 320 | assert typeinfo.type_id == TypeId.BFLOAT16_ARRAY |
| 321 | decoded = ser_de(fory, values) |
| 322 | assert isinstance(decoded, pyfory.BFloat16Array) |
| 323 | assert list(decoded.to_buffer()) == [0x0000, 0x3F80, 0xC000] |
| 324 | |
| 325 | |
| 326 | def test_bfloat16_array_from_values(): |
nothing calls this directly
no test coverage detected