diff options
author | Anders Carlsson <andersca@codefactory.se> | 2003-03-10 00:13:55 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@codefactory.se> | 2003-03-10 00:13:55 +0000 |
commit | 799a3ff443f5357ae7857ebe989a7f92f7bd84df (patch) | |
tree | 5217028097693381989fa0a1480e0ac863cba58a /test/data | |
parent | 1458fb145fdfe7e7ca11c88f8e2f117d90a906d8 (diff) | |
download | dbus-799a3ff443f5357ae7857ebe989a7f92f7bd84df.tar.gz |
2003-03-10 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-marshal.c:
(_dbus_marshal_set_string):
Take a length argument so we can marshal the correct string
length.
(_dbus_marshal_dict), (_dbus_demarshal_dict),
(_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
(_dbus_marshal_test):
* dbus/dbus-marshal.h:
Add support for marshalling and demarshalling dicts.
* dbus/dbus-message-builder.c: (_dbus_message_data_load):
Add support for TYPE DICT.
* dbus/dbus-message.c: (set_string_field):
Adjust header padding.
(dbus_message_append_args_valist), (dbus_message_append_dict),
(dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
(dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
(check_message_handling), (check_have_valid_message):
* dbus/dbus-message.h:
Add functions for setting and getting dicts.
* dbus/dbus-protocol.h:
Add DBUS_TYPE_DICT.
* dbus/dbus.h:
Add dbus-dict.h
* doc/dbus-specification.sgml:
Add information about how dicts are marshalled.
* test/data/invalid-messages/dict-with-nil-value.message:
* test/data/invalid-messages/too-short-dict.message:
* test/data/valid-messages/dict-simple.message:
* test/data/valid-messages/dict.message:
Add sample messages containing dicts.
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/invalid-messages/dict-with-nil-value.message | 12 | ||||
-rw-r--r-- | test/data/invalid-messages/too-short-dict.message | 11 | ||||
-rw-r--r-- | test/data/valid-messages/dict-simple.message | 11 | ||||
-rw-r--r-- | test/data/valid-messages/dict.message | 29 |
4 files changed, 63 insertions, 0 deletions
diff --git a/test/data/invalid-messages/dict-with-nil-value.message b/test/data/invalid-messages/dict-with-nil-value.message new file mode 100644 index 00000000..8f899605 --- /dev/null +++ b/test/data/invalid-messages/dict-with-nil-value.message @@ -0,0 +1,12 @@ +# Message with lots of different argument types + +VALID_HEADER +END_LENGTH Header +ALIGN 8 +START_LENGTH Body +TYPE DICT +STRING_ARRAY { 'nil', 'uint32' } +TYPE NIL +TYPE UINT32 +UINT32 0x8765432 +END_LENGTH Body diff --git a/test/data/invalid-messages/too-short-dict.message b/test/data/invalid-messages/too-short-dict.message new file mode 100644 index 00000000..6df40b33 --- /dev/null +++ b/test/data/invalid-messages/too-short-dict.message @@ -0,0 +1,11 @@ +# Message with lots of different argument types + +VALID_HEADER +END_LENGTH Header +ALIGN 8 +START_LENGTH Body +TYPE DICT +STRING_ARRAY { 'int32', 'uint32' } +TYPE UINT32 +UINT32 0x8765432 +END_LENGTH Body diff --git a/test/data/valid-messages/dict-simple.message b/test/data/valid-messages/dict-simple.message new file mode 100644 index 00000000..0b9d0186 --- /dev/null +++ b/test/data/valid-messages/dict-simple.message @@ -0,0 +1,11 @@ +# A simple dict + +VALID_HEADER +END_LENGTH Header +ALIGN 8 +START_LENGTH Body +TYPE DICT +STRING_ARRAY { 'int32' } +TYPE INT32 +INT32 0x12345678 +END_LENGTH Body diff --git a/test/data/valid-messages/dict.message b/test/data/valid-messages/dict.message new file mode 100644 index 00000000..0532e682 --- /dev/null +++ b/test/data/valid-messages/dict.message @@ -0,0 +1,29 @@ +# Dict with different values + +VALID_HEADER +END_LENGTH Header +ALIGN 8 +START_LENGTH Body +TYPE DICT +STRING_ARRAY { 'boolean', 'int32', 'uint32', 'double', 'string', 'boolean_array', 'int32_array', 'uint32_array', 'double_array', 'string_array' } +TYPE BOOLEAN +BYTE 1 +TYPE INT32 +INT32 0x12345678 +TYPE UINT32 +UINT32 0x8765432 +TYPE DOUBLE +DOUBLE 3.141592653589 +TYPE STRING +STRING 'This is a string' +TYPE BOOLEAN_ARRAY +BOOLEAN_ARRAY { true, false, false, true, false } +TYPE INT32_ARRAY +INT32_ARRAY { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10 } +TYPE UINT32_ARRAY +UINT32_ARRAY { 11, 12, 314, 1911, 57692, 1237, 2834 } +TYPE DOUBLE_ARRAY +DOUBLE_ARRAY { 0.1, 0.2, 3.1415926, 2.7183, 10.0, 9.99 } +TYPE STRING_ARRAY +STRING_ARRAY { 'Hello', 'This', 'Is', 'A', 'String', 'Array!' } +END_LENGTH Body |