From a8c66bba70390f4f1572d3afe675b13c3d870c0c Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Thu, 12 Dec 2013 17:17:48 +0200 Subject: [PATCH] android/tester: Check that fd is valid for Success case For the successful test case check that file descriptor is valid through fcntl which is cheap way. --- android/android-tester.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/android-tester.c b/android/android-tester.c index df673c43d..39f799108 100644 --- a/android/android-tester.c +++ b/android/android-tester.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -740,6 +741,12 @@ static void test_generic_listen(const void *test_data) goto clean; } + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) == -1) { + tester_test_failed(); + return; + } + tester_test_passed(); clean: