summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2011-06-26 23:06:16 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:21:56 +0100
commit8d451283e0d48f93620d93fad5d66d3e0edaeebf (patch)
tree1ca1b2aff18790f514955e87a9d155fa98776c7e /unit
parent352a739a897f4575c21fd520288574302a54cb8d (diff)
gobex: Add basic request decoding support
Diffstat (limited to 'unit')
-rw-r--r--unit/test-gobex.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/unit/test-gobex.c b/unit/test-gobex.c
index 8504a7eab..ddbf9ac0d 100644
--- a/unit/test-gobex.c
+++ b/unit/test-gobex.c
@@ -149,6 +149,17 @@ static void test_header_uint32(void)
g_obex_header_free(header);
}
+static void test_decode_req(void)
+{
+ GObexRequest *req;
+ uint8_t buf[] = { G_OBEX_OP_PUT, 0x00, 0x03 };
+
+ req = g_obex_request_decode(buf, sizeof(buf), G_OBEX_DATA_REF);
+ g_assert(req != NULL);
+
+ g_obex_request_free(req);
+}
+
static void parse_and_encode(uint8_t *buf, size_t buf_len)
{
GObexHeader *header;
@@ -411,6 +422,8 @@ int main(int argc, char *argv[])
g_test_add_func("/gobex/test_header_uint8", test_header_uint8);
g_test_add_func("/gobex/test_header_uint32", test_header_uint32);
+ g_test_add_func("/gobex/test_decode_req", test_decode_req);
+
g_test_run();
return 0;