Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libbluetooth test that data element lists are not ...



details:   https://anonhg.NetBSD.org/src/rev/6a05acc54fb7
branches:  trunk
changeset: 764323:6a05acc54fb7
user:      plunky <plunky%NetBSD.org@localhost>
date:      Sat Apr 16 07:32:27 2011 +0000

description:
test that data element lists are not placed by sdp_put_attr(), as
an attribute/value pair should only contain a single data element

diffstat:

 tests/lib/libbluetooth/t_sdp_put.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 985a6ef8a90b -r 6a05acc54fb7 tests/lib/libbluetooth/t_sdp_put.c
--- a/tests/lib/libbluetooth/t_sdp_put.c        Sat Apr 16 07:19:36 2011 +0000
+++ b/tests/lib/libbluetooth/t_sdp_put.c        Sat Apr 16 07:32:27 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_sdp_put.c,v 1.2 2011/04/07 08:29:50 plunky Exp $     */
+/*     $NetBSD: t_sdp_put.c,v 1.3 2011/04/16 07:32:27 plunky Exp $     */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -81,10 +81,13 @@
        uint8_t buf[256];
        sdp_data_t test = { buf, buf + sizeof(buf) };
        uint8_t data[] = {
+               0x00,                   // nil
                0x19, 0x33, 0x44,       // uuid16       0x3344
        };
        sdp_data_t value = { data, data + sizeof(data) };
 
+       ATF_REQUIRE_EQ(sdp_put_attr(&test, 0xabcd, &value), false);
+       value.next += 1; // skip "nil"
        ATF_REQUIRE(sdp_put_attr(&test, 0x1337, &value));
        test.end = test.next;
        test.next = buf;



Home | Main Index | Thread Index | Old Index