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

Function test_multiple_ref

python/pyfory/tests/test_serializer.py:529–539  ·  view source on GitHub ↗
(xlang)

Source from the content-addressed store, hash-verified

527
528@pytest.mark.parametrize("xlang", [False, True])
529def test_multiple_ref(xlang):
530 # FIXME this can't simulate the case where new objects are allocated on memory
531 # address of released tmp object.
532 fory = Fory(xlang=xlang, ref=True, compatible=xlang)
533 buffer = Buffer.allocate(128)
534 for i in range(1000):
535 fory.serialize([], buffer)
536 objs = []
537 for i in range(1000):
538 objs.append(fory.deserialize(buffer))
539 assert len(set(id(o) for o in objs)) == 1000
540
541
542class RefTestClass1:

Callers

nothing calls this directly

Calls 6

serializeMethod · 0.95
deserializeMethod · 0.95
ForyClass · 0.90
allocateMethod · 0.65
setFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected