Return-Path: From: Andrei Emeltchenko To: linux-bluetooth@vger.kernel.org Subject: [PATCHv1 6/9] unit/avdtp: Add check for too many SEP creation Date: Fri, 13 Feb 2015 11:06:05 +0200 Message-Id: <1423818368-15899-7-git-send-email-Andrei.Emeltchenko.news@gmail.com> In-Reply-To: <1423818368-15899-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> References: <1423818368-15899-1-git-send-email-Andrei.Emeltchenko.news@gmail.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: From: Andrei Emeltchenko Test checks that maximum numbers of SEPs registered is MAX_SEID. --- unit/test-avdtp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c index 60eea7a..471cdde 100644 --- a/unit/test-avdtp.c +++ b/unit/test-avdtp.c @@ -578,6 +578,13 @@ static void test_server_seid(gconstpointer data) lseps = g_slist_append(lseps, sep); } + /* Now add (MAX_SEID + 1) SEP -> it shall fail */ + sep = avdtp_register_sep(AVDTP_SEP_TYPE_SINK, + AVDTP_MEDIA_TYPE_AUDIO, + 0x00, TRUE, &sep_ind, NULL, + context); + g_assert(!sep); + /* Remove all SEPs */ g_slist_free_full(lseps, unregister_sep); lseps = NULL; -- 2.1.0