From 96283b9a5b65ada7e4c34111dc87776b07dbc117 Mon Sep 17 00:00:00 2001 From: Marcin Kraglak Date: Fri, 10 Jan 2014 10:18:23 +0100 Subject: [PATCH] tools/rfcomm-tester: Add Connection refused client test case This will test RFCOMM client connection to wrong server channel. --- tools/rfcomm-tester.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c index 271f5540f..f471c3b5b 100644 --- a/tools/rfcomm-tester.c +++ b/tools/rfcomm-tester.c @@ -262,6 +262,12 @@ const struct rfcomm_client_data connect_success = { .client_channel = 0x0c }; +const struct rfcomm_client_data connect_nval = { + .server_channel = 0x0c, + .client_channel = 0x0e, + .expected_connect_err = -ECONNREFUSED +}; + static void test_basic(const void *test_data) { int sk; @@ -399,6 +405,8 @@ int main(int argc, char *argv[]) setup_powered_client, test_basic); test_rfcomm("Basic RFCOMM Socket Client - Success", &connect_success, setup_powered_client, test_connect); + test_rfcomm("Basic RFCOMM Socket Client - Conn Refused", + &connect_nval, setup_powered_client, test_connect); return tester_run(); } -- 2.47.3