MCPcopy Create free account
hub / github.com/apache/fory / testStructVersionCheck

Function testStructVersionCheck

go/fory/tests/xlang/xlang_test_main.go:1231–1250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1229}
1230
1231func testStructVersionCheck() {
1232 dataFile := getDataFile()
1233 data := readFile(dataFile)
1234
1235 f := fory.New(fory.WithXlang(true), fory.WithCompatible(false))
1236 // Use numeric ID 201 to match Java's fory.register(VersionCheckStruct.class, 201)
1237 f.RegisterStruct(VersionCheckStruct{}, 201)
1238
1239 var obj VersionCheckStruct
1240 if err := f.Deserialize(data, &obj); err != nil {
1241 panic(fmt.Sprintf("Failed to deserialize: %v", err))
1242 }
1243
1244 serialized, err := f.Serialize(&obj)
1245 if err != nil {
1246 panic(fmt.Sprintf("Failed to serialize: %v", err))
1247 }
1248
1249 writeFile(dataFile, serialized)
1250}
1251
1252func testPolymorphicList() {
1253 dataFile := getDataFile()

Callers 1

mainFunction · 0.85

Calls 6

getDataFileFunction · 0.85
readFileFunction · 0.85
writeFileFunction · 0.85
RegisterStructMethod · 0.45
DeserializeMethod · 0.45
SerializeMethod · 0.45

Tested by

no test coverage detected