summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2003-09-21 18:43:20 +0000
committerMark McLoughlin <mark@skynet.ie>2003-09-21 18:43:20 +0000
commitdaf8d6579e1ae0ea748810b63180bd5eea2ab9c4 (patch)
tree940fca6401e72cfbf8ed47fd9b185f21377483b2 /test
parentfafc38bb45db8031fc6f252e86df86dc585fefc9 (diff)
2003-09-21 Mark McLoughlin <mark@skynet.ie>
* doc/dbus-specification.sgml: Change the header field name to be an enum and update the rest of the spec to reference the fields using the conventinal name. * dbus/dbus-protocol.h: update to reflect the spec. * doc/TODO: add item to remove the 4 byte alignment requirement. * dbus/dbus-message.c: Remove the code to generalise the header/body length and serial number header fields as named header fields so we can reference field names using the protocol values. (append_int_field), (append_uint_field), (append_string_field): Append the field name as a byte rather than four chars. (delete_int_or_uint_field), (delete_string_field): reflect the fact that the field name and typecode now occupy 4 bytes instead of 8. (decode_string_field), (decode_header_data): update to reflect protocol changes and move the field specific encoding from decode_string_field() back into decode_header_data(). * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string): Add utility to aid debugging. * dbus/dbus-message-builder.c: (append_string_field), (_dbus_message_data_load): Update to reflect protocol changes; Change the FIELD_NAME directive to HEADER_FIELD and allow it to take the field's conventional name rather than the actual value. * test/data/*/*.message: Update to use HEADER_FIELD instead of FIELD_NAME; Always align the header on an 8 byte boundary *before* updating the header length.
Diffstat (limited to 'test')
-rw-r--r--test/data/incomplete-messages/missing-body.message6
-rw-r--r--test/data/invalid-messages/array-of-nil.message7
-rw-r--r--test/data/invalid-messages/array-with-mixed-types.message7
-rw-r--r--test/data/invalid-messages/bad-boolean-array.message5
-rw-r--r--test/data/invalid-messages/bad-boolean.message5
-rw-r--r--test/data/invalid-messages/bad-endian.message5
-rw-r--r--test/data/invalid-messages/local-namespace.message5
-rw-r--r--test/data/invalid-messages/no-dot-in-name.message4
-rw-r--r--test/data/invalid-messages/not-nul-header-padding.message6
-rw-r--r--test/data/invalid-messages/overlong-name.message4
-rw-r--r--test/data/invalid-messages/too-little-header-padding.message6
-rw-r--r--test/data/invalid-messages/too-much-header-padding-by-far.message6
-rw-r--r--test/data/invalid-messages/too-much-header-padding.message6
-rw-r--r--test/data/invalid-messages/too-short-dict.message4
-rw-r--r--test/data/valid-messages/array-of-array-of-uint32.message2
-rw-r--r--test/data/valid-messages/dict-simple.message2
-rw-r--r--test/data/valid-messages/emptiness.message2
-rw-r--r--test/data/valid-messages/lots-of-arguments.message2
-rw-r--r--test/data/valid-messages/no-padding.message2
-rw-r--r--test/data/valid-messages/opposite-endian.message2
-rw-r--r--test/data/valid-messages/recursive-types.message1
-rw-r--r--test/data/valid-messages/simplest-manual.message6
-rw-r--r--test/data/valid-messages/standard-acquire-service.message8
-rw-r--r--test/data/valid-messages/standard-hello.message8
-rw-r--r--test/data/valid-messages/standard-list-services.message8
-rw-r--r--test/data/valid-messages/standard-service-exists.message8
-rw-r--r--test/data/valid-messages/unknown-header-field.message2
27 files changed, 67 insertions, 62 deletions
diff --git a/test/data/incomplete-messages/missing-body.message b/test/data/incomplete-messages/missing-body.message
index 69e371e0..138e9ea5 100644
--- a/test/data/incomplete-messages/missing-body.message
+++ b/test/data/incomplete-messages/missing-body.message
@@ -1,14 +1,14 @@
## message that's missing an expected body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
## create the body, then chop it off
START_LENGTH Body
diff --git a/test/data/invalid-messages/array-of-nil.message b/test/data/invalid-messages/array-of-nil.message
index 4810d318..7f0ac718 100644
--- a/test/data/invalid-messages/array-of-nil.message
+++ b/test/data/invalid-messages/array-of-nil.message
@@ -2,15 +2,16 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
TYPE NIL
diff --git a/test/data/invalid-messages/array-with-mixed-types.message b/test/data/invalid-messages/array-with-mixed-types.message
index 1bdd549b..4455c898 100644
--- a/test/data/invalid-messages/array-with-mixed-types.message
+++ b/test/data/invalid-messages/array-with-mixed-types.message
@@ -3,15 +3,16 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
diff --git a/test/data/invalid-messages/bad-boolean-array.message b/test/data/invalid-messages/bad-boolean-array.message
index e4df1903..91ad5ef1 100644
--- a/test/data/invalid-messages/bad-boolean-array.message
+++ b/test/data/invalid-messages/bad-boolean-array.message
@@ -3,15 +3,16 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
TYPE ARRAY
TYPE BOOLEAN
diff --git a/test/data/invalid-messages/bad-boolean.message b/test/data/invalid-messages/bad-boolean.message
index 7b518d57..cd588ad8 100644
--- a/test/data/invalid-messages/bad-boolean.message
+++ b/test/data/invalid-messages/bad-boolean.message
@@ -3,15 +3,16 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
TYPE BOOLEAN
BYTE 3
diff --git a/test/data/invalid-messages/bad-endian.message b/test/data/invalid-messages/bad-endian.message
index c08f0188..8d609244 100644
--- a/test/data/invalid-messages/bad-endian.message
+++ b/test/data/invalid-messages/bad-endian.message
@@ -8,15 +8,14 @@ BYTE 0
LENGTH Header
LENGTH Body
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
ALIGN 8
-
END_LENGTH Header
START_LENGTH Body
diff --git a/test/data/invalid-messages/local-namespace.message b/test/data/invalid-messages/local-namespace.message
index f485d70c..dad98a77 100644
--- a/test/data/invalid-messages/local-namespace.message
+++ b/test/data/invalid-messages/local-namespace.message
@@ -4,14 +4,15 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Local'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Disconnected'
ALIGN 8
END_LENGTH Header
+
START_LENGTH Body
END_LENGTH Body
diff --git a/test/data/invalid-messages/no-dot-in-name.message b/test/data/invalid-messages/no-dot-in-name.message
index 53e288d0..131be05d 100644
--- a/test/data/invalid-messages/no-dot-in-name.message
+++ b/test/data/invalid-messages/no-dot-in-name.message
@@ -3,10 +3,10 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'NoDotInHere'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
diff --git a/test/data/invalid-messages/not-nul-header-padding.message b/test/data/invalid-messages/not-nul-header-padding.message
index f98812c2..a12c0fa7 100644
--- a/test/data/invalid-messages/not-nul-header-padding.message
+++ b/test/data/invalid-messages/not-nul-header-padding.message
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
diff --git a/test/data/invalid-messages/overlong-name.message b/test/data/invalid-messages/overlong-name.message
index 4108a037..4fd7025e 100644
--- a/test/data/invalid-messages/overlong-name.message
+++ b/test/data/invalid-messages/overlong-name.message
@@ -2,11 +2,11 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.foo.bar.this.is.really.long 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
diff --git a/test/data/invalid-messages/too-little-header-padding.message b/test/data/invalid-messages/too-little-header-padding.message
index f6e7af4b..894e4c3e 100644
--- a/test/data/invalid-messages/too-little-header-padding.message
+++ b/test/data/invalid-messages/too-little-header-padding.message
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
diff --git a/test/data/invalid-messages/too-much-header-padding-by-far.message b/test/data/invalid-messages/too-much-header-padding-by-far.message
index 6cc5b391..b74f559b 100644
--- a/test/data/invalid-messages/too-much-header-padding-by-far.message
+++ b/test/data/invalid-messages/too-much-header-padding-by-far.message
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
diff --git a/test/data/invalid-messages/too-much-header-padding.message b/test/data/invalid-messages/too-much-header-padding.message
index 6cf004b9..01111b63 100644
--- a/test/data/invalid-messages/too-much-header-padding.message
+++ b/test/data/invalid-messages/too-much-header-padding.message
@@ -3,14 +3,14 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE STRING
STRING 'a'
ALIGN 8
diff --git a/test/data/invalid-messages/too-short-dict.message b/test/data/invalid-messages/too-short-dict.message
index 59621126..fde88850 100644
--- a/test/data/invalid-messages/too-short-dict.message
+++ b/test/data/invalid-messages/too-short-dict.message
@@ -2,10 +2,10 @@
VALID_HEADER method_call
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
diff --git a/test/data/valid-messages/array-of-array-of-uint32.message b/test/data/valid-messages/array-of-array-of-uint32.message
index 692eca06..e12186b1 100644
--- a/test/data/valid-messages/array-of-array-of-uint32.message
+++ b/test/data/valid-messages/array-of-array-of-uint32.message
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE ARRAY
diff --git a/test/data/valid-messages/dict-simple.message b/test/data/valid-messages/dict-simple.message
index 6986d439..fa6927df 100644
--- a/test/data/valid-messages/dict-simple.message
+++ b/test/data/valid-messages/dict-simple.message
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE DICT
LENGTH Dict
diff --git a/test/data/valid-messages/emptiness.message b/test/data/valid-messages/emptiness.message
index dbf531ca..32042c01 100644
--- a/test/data/valid-messages/emptiness.message
+++ b/test/data/valid-messages/emptiness.message
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE STRING
INT32 0
diff --git a/test/data/valid-messages/lots-of-arguments.message b/test/data/valid-messages/lots-of-arguments.message
index 993755ab..d3f6a4ee 100644
--- a/test/data/valid-messages/lots-of-arguments.message
+++ b/test/data/valid-messages/lots-of-arguments.message
@@ -2,8 +2,8 @@
VALID_HEADER method_call
REQUIRED_FIELDS
-END_LENGTH Header
ALIGN 8
+END_LENGTH Header
START_LENGTH Body
TYPE NIL
TYPE BYTE
diff --git a/test/data/valid-messages/no-padding.message b/test/data/valid-messages/no-padding.message
index e6d27d9d..94df4d45 100644
--- a/test/data/valid-messages/no-padding.message
+++ b/test/data/valid-messages/no-padding.message
@@ -7,7 +7,7 @@ REQUIRED_FIELDS
## this byte array is filled with zeros to the natural length
## of the header
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE ARRAY
TYPE BYTE
ALIGN 4
diff --git a/test/data/valid-messages/opposite-endian.message b/test/data/valid-messages/opposite-endian.message
index c638b7b0..90949dd2 100644
--- a/test/data/valid-messages/opposite-endian.message
+++ b/test/data/valid-messages/opposite-endian.message
@@ -7,7 +7,7 @@ VALID_HEADER method_call
REQUIRED_FIELDS
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE INT32
INT32 0xfeeb
diff --git a/test/data/valid-messages/recursive-types.message b/test/data/valid-messages/recursive-types.message
index 192fd9b7..e306fd1f 100644
--- a/test/data/valid-messages/recursive-types.message
+++ b/test/data/valid-messages/recursive-types.message
@@ -5,6 +5,7 @@ VALID_HEADER method_call
REQUIRED_FIELDS
+ALIGN 8
END_LENGTH Header
START_LENGTH Body
diff --git a/test/data/valid-messages/simplest-manual.message b/test/data/valid-messages/simplest-manual.message
index 9779234b..5a5b4105 100644
--- a/test/data/valid-messages/simplest-manual.message
+++ b/test/data/valid-messages/simplest-manual.message
@@ -11,13 +11,13 @@ LENGTH Body
## client serial
INT32 7
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/foo'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.Foo'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Bar'
diff --git a/test/data/valid-messages/standard-acquire-service.message b/test/data/valid-messages/standard-acquire-service.message
index f313061f..a42a639c 100644
--- a/test/data/valid-messages/standard-acquire-service.message
+++ b/test/data/valid-messages/standard-acquire-service.message
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.AcquireService message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'AcquireService'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
diff --git a/test/data/valid-messages/standard-hello.message b/test/data/valid-messages/standard-hello.message
index 795ede74..50d4e0ff 100644
--- a/test/data/valid-messages/standard-hello.message
+++ b/test/data/valid-messages/standard-hello.message
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.Hello message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'Hello'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
diff --git a/test/data/valid-messages/standard-list-services.message b/test/data/valid-messages/standard-list-services.message
index 4c9c7c66..10c9a2f7 100644
--- a/test/data/valid-messages/standard-list-services.message
+++ b/test/data/valid-messages/standard-list-services.message
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.ListServices message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'ListServices'
-FIELD_NAME srvc
+HEADER_FIELD SERVICES
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
diff --git a/test/data/valid-messages/standard-service-exists.message b/test/data/valid-messages/standard-service-exists.message
index ce14811a..c3b715bc 100644
--- a/test/data/valid-messages/standard-service-exists.message
+++ b/test/data/valid-messages/standard-service-exists.message
@@ -1,16 +1,16 @@
# Standard org.freedesktop.DBus.ServiceExists message
VALID_HEADER method_call
-FIELD_NAME path
+HEADER_FIELD PATH
TYPE OBJECT_PATH
OBJECT_PATH '/org/freedesktop/DBus'
-FIELD_NAME ifce
+HEADER_FIELD INTERFACE
TYPE STRING
STRING 'org.freedesktop.DBus'
-FIELD_NAME mebr
+HEADER_FIELD MEMBER
TYPE STRING
STRING 'ServiceExists'
-FIELD_NAME srvc
+HEADER_FIELD SERVICE
TYPE STRING
STRING 'org.freedesktop.DBus'
ALIGN 8
diff --git a/test/data/valid-messages/unknown-header-field.message b/test/data/valid-messages/unknown-header-field.message
index 5d95f812..973def68 100644
--- a/test/data/valid-messages/unknown-header-field.message
+++ b/test/data/valid-messages/unknown-header-field.message
@@ -3,7 +3,7 @@
## VALID_HEADER includes a LENGTH Header and LENGTH Body
VALID_HEADER method_call
REQUIRED_FIELDS
-FIELD_NAME unkn
+HEADER_FIELD UNKNOWN
TYPE INT32
INT32 0xfeeb
ALIGN 8