From: Radoslaw Jablonski <radoslawjablonski@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Radoslaw Jablonski <radoslawjablonski@gmail.com>
Subject: [PATCH Bluez 5/7] Add unit test for sdp_seq_alloc_with_length func
Date: Wed, 8 Feb 2012 12:40:53 +0100 [thread overview]
Message-ID: <1328701255-24245-6-git-send-email-radoslawjablonski@gmail.com> (raw)
In-Reply-To: <1328701255-24245-1-git-send-email-radoslawjablonski@gmail.com>
1 new test case sdp_seq_alloc_with_length from
lib/sdp.c code.
---
unit/test-sdp.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index 8ce802d..76a8435 100644
--- a/unit/test-sdp.c
+++ b/unit/test-sdp.c
@@ -287,6 +287,21 @@ START_TEST(tc_sdp_data_alloc_null)
}
END_TEST
+/* sdp_seq_alloc_with_length testcases */
+START_TEST(tc_sdp_seq_alloc_with_length_zero)
+{
+ sdp_data_t *ret;
+ int lengths[2] = {0, 0};
+
+ ret = sdp_seq_alloc_with_length(NULL, NULL, lengths, 0);
+
+ ck_assert(ret->val.dataseq == NULL);
+ ck_assert(ret->unitSize == 2 * sizeof(uint8_t));
+
+ sdp_data_free(ret);
+}
+END_TEST
+
static void add_test(Suite *s, const char *name, TFun func)
{
TCase *t;
@@ -339,6 +354,9 @@ int main(int argc, char *argv[])
tc_sdp_data_alloc_with_length_text_unspec);
/* sdp_data_alloc testcases */
add_test(s, "sdp_data_alloc:NULL param", tc_sdp_data_alloc_null);
+ /* sdp_seq_alloc_with_length testcases */
+ add_test(s, "sdp_seq_alloc_with_length:zero length param",
+ tc_sdp_seq_alloc_with_length_zero);
sr = srunner_create(s);
--
1.7.0.4
next prev parent reply other threads:[~2012-02-08 11:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 11:40 [PATCH Bluez 0/7] Set of unit tests for lib/sdp Radoslaw Jablonski
2012-02-08 11:40 ` [PATCH Bluez 1/7] Add skeleton for " Radoslaw Jablonski
2012-02-08 11:40 ` [PATCH Bluez 2/7] Add unit tests for uuid2strn func in lib/sdp Radoslaw Jablonski
2012-02-08 11:40 ` [PATCH Bluez 3/7] Add unit tests for sdp_data_alloc_with_length func Radoslaw Jablonski
2012-02-08 11:40 ` [PATCH Bluez 4/7] Add unit test for sdp_data_alloc func Radoslaw Jablonski
2012-02-08 11:40 ` Radoslaw Jablonski [this message]
2012-02-08 11:40 ` [PATCH Bluez 6/7] Add unit test for sdp_attr_add func Radoslaw Jablonski
2012-02-08 11:40 ` [PATCH Bluez 7/7] Add unit tests for sdp_attr_remove func Radoslaw Jablonski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1328701255-24245-6-git-send-email-radoslawjablonski@gmail.com \
--to=radoslawjablonski@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).