From ce397dee70eb03358da6eb1c1ca19ed7cf155a62 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 26 Oct 2013 13:35:15 +0200 Subject: lapd: Extend the test to check if lapdm_channel_exit is idempotent I have a crash with an older libosmocore and the sysmobts. I am not sure how we can have a release for a channel where the lapdm_channel has not gone through lapdm_channel_init. But to prevent the crash we can promise lapdm_channel_exit to be idempotent. It has been idempotent since f5a079f739c57d8be7c59149fd45475c402a45fc --- tests/lapd/lapd_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c index 1f986bc8..37c0db8d 100644 --- a/tests/lapd/lapd_test.c +++ b/tests/lapd/lapd_test.c @@ -344,6 +344,10 @@ static void test_lapdm_polling() /* clean up */ lapdm_channel_exit(&bts_to_ms_channel); lapdm_channel_exit(&ms_to_bts_channel); + + /* Check if exit is idempotent */ + lapdm_channel_exit(&bts_to_ms_channel); + lapdm_channel_exit(&ms_to_bts_channel); } static void test_lapdm_early_release() @@ -372,6 +376,9 @@ static void test_lapdm_early_release() /* clean up */ lapdm_channel_exit(&bts_to_ms_channel); + + /* Check if exit is idempotent */ + lapdm_channel_exit(&bts_to_ms_channel); } static void test_lapdm_contention_resolution() @@ -415,6 +422,9 @@ static void test_lapdm_contention_resolution() /* clean up */ lapdm_channel_exit(&bts_to_ms_channel); + + /* idempotent */ + lapdm_channel_exit(&bts_to_ms_channel); } int main(int argc, char **argv) -- cgit v1.2.3