diff --git a/src/dbus_fast/_private/marshaller.py b/src/dbus_fast/_private/marshaller.py index 777fe1c..2e7e3e2 100644 --- a/src/dbus_fast/_private/marshaller.py +++ b/src/dbus_fast/_private/marshaller.py @@ -20,8 +20,9 @@ class Marshaller: return offset def write_boolean(self, boolean: bool, _=None) -> int: + written = self.align(4) self.buffer.extend(PACK_UINT32(int(boolean))) - return self.align(4) + 4 + return written + 4 def write_signature(self, signature: str, _=None) -> int: signature = signature.encode() diff --git a/tests/data/messages.json b/tests/data/messages.json index fcce840..a979847 100644 --- a/tests/data/messages.json +++ b/tests/data/messages.json @@ -230,5 +230,17 @@ ] }, "data": "6c01000120000000010000007900000001016f00150000002f6f72672f667265656465736b746f702f4442757300000002017300140000006f72672e667265656465736b746f702e4442757300000000030173000500000048656c6c6f00000006017300140000006f72672e667265656465736b746f702e444275730000000008016700037661730000000000000000017600017300000005000000776f726c64000000080000000300000062617200" + }, + { + "message": { + "destination": "org.freedesktop.DBus", + "path": "/org/freedesktop/DBus", + "interface": "org.freedesktop.DBus", + "member": "Hello", + "serial": 1, + "signature": "asbbasbb", + "body": [["hello", "worl"], true, false, ["hello", "worl"], true, false] + }, + "data": "6c01000148000000010000007e00000001016f00150000002f6f72672f667265656465736b746f702f4442757300000002017300140000006f72672e667265656465736b746f702e4442757300000000030173000500000048656c6c6f00000006017300140000006f72672e667265656465736b746f702e444275730000000008016700086173626261736262000000150000000500000068656c6c6f00000004000000776f726c000000000100000000000000150000000500000068656c6c6f00000004000000776f726c000000000100000000000000" } ]