TestSerializeZeroCopy is temporarily disabled during API refactoring TODO: Re-enable when zero-copy serialization API is updated * func TestSerializeZeroCopy(t *testing.T) { fory := NewFory(WithXlang(true), WithCompatible(false), WithRefTracking(true)) list := []any{"str", make([]byte, 1000)} buf
(value any)
| 565 | */ |
| 566 | |
| 567 | func marshalTestValue(value any) any { |
| 568 | if value == nil { |
| 569 | return value |
| 570 | } |
| 571 | valueRef := reflect.ValueOf(value) |
| 572 | if valueRef.Kind() == reflect.Struct { |
| 573 | ptr := reflect.New(valueRef.Type()) |
| 574 | ptr.Elem().Set(valueRef) |
| 575 | return ptr.Interface() |
| 576 | } |
| 577 | return value |
| 578 | } |
| 579 | |
| 580 | func serDeserializeTo(t *testing.T, fory *Fory, value any, to any) { |
| 581 | marshalValue := marshalTestValue(value) |
no test coverage detected