test: use the callback's version instead of hardcoding it a second time

Fixes f081e8e79f
This commit is contained in:
Peter Hutterer 2023-06-02 10:28:50 +10:00
parent ed1acbbd7c
commit 7d0536f344

View file

@ -148,7 +148,7 @@ class Ei:
cb = EiCallback.create(next(self.object_ids), VERSION_V(1))
self.context.register(cb)
self.send(self.connection.Sync(cb.object_id, VERSION_V(1)))
self.send(self.connection.Sync(cb.object_id, cb.version))
return self.wait_for(
lambda: cb not in self.find_objects_by_interface(InterfaceName.EI_CALLBACK)
@ -715,7 +715,7 @@ class TestEiProtocol:
cb = EiCallback.create(next(ei.object_ids), VERSION_V(1))
ei.context.register(cb)
assert ei.connection is not None
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
ei.dispatch()
assert cb.calllog[0].name == "Done"
@ -759,7 +759,7 @@ class TestEiProtocol:
# Send the invalid object request
ei.send(release)
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
ei.wait_for(lambda: have_sync)
assert have_invalid_object_event, "Expected invalid_object event, got none"
@ -923,20 +923,20 @@ class TestEiProtocol:
# and some of the next few ids might have been used by pingpongs
cb = EiCallback.create(0xFF00000000000100, VERSION_V(1))
ei.context.register(cb)
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
elif test_for == "repeat-id":
cb = EiCallback.create(0x100, VERSION_V(1))
ei.context.register(cb)
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
cb = EiCallback.create(0x100, VERSION_V(1))
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
elif test_for == "decreasing-id":
cb = EiCallback.create(0x101, VERSION_V(1))
ei.context.register(cb)
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
cb = EiCallback.create(0x100, VERSION_V(1))
ei.context.register(cb)
ei.send(ei.connection.Sync(cb.object_id, VERSION_V(1)))
ei.send(ei.connection.Sync(cb.object_id, cb.version))
else:
assert False, "Unhandled test parameter"