Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/6] android/tester: Fix for not checking for BT_STATUS_SUCCESS
@ 2013-12-19 12:42 Jakub Tyszkowski
  2013-12-19 12:42 ` [PATCH 2/6] android/tester: Fix bluetooth disable success test case Jakub Tyszkowski
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jakub Tyszkowski @ 2013-12-19 12:42 UTC (permalink / raw)
  To: linux-bluetooth

For BT_STATUS_SUCCESS no checks were done as it is 0 in bt_status_t
enum. Valid status for no status expected should be STATUS_NOT_EXPECTED.

---
 android/android-tester.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/android/android-tester.c b/android/android-tester.c
index c24f5a6..5549dcb 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -72,7 +72,7 @@ enum hal_bluetooth_callbacks_id {
 };
 
 struct generic_data {
-	uint8_t expected_adapter_status;
+	int expected_adapter_status;
 	uint32_t expect_settings_set;
 	bt_property_t expected_property;
 	uint8_t expected_hal_callbacks[];
@@ -92,6 +92,8 @@ struct socket_data {
 #define WAIT_FOR_SIGNAL_TIME 2 /* in seconds */
 #define EMULATOR_SIGNAL "emulator_started"
 
+#define BT_STATUS_NOT_EXPECTED	-1
+
 struct test_data {
 	struct mgmt *mgmt;
 	uint16_t mgmt_index;
@@ -199,7 +201,7 @@ static void expected_status_init(struct test_data *data)
 {
 	const struct generic_data *test_data = data->test_data;
 
-	if (!(test_data->expected_adapter_status))
+	if (test_data->expected_adapter_status == BT_STATUS_NOT_EXPECTED)
 		data->status_checked = true;
 }
 
-- 
1.8.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-12-19 14:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 12:42 [PATCH 1/6] android/tester: Fix for not checking for BT_STATUS_SUCCESS Jakub Tyszkowski
2013-12-19 12:42 ` [PATCH 2/6] android/tester: Fix bluetooth disable success test case Jakub Tyszkowski
2013-12-19 12:42 ` [PATCH 3/6] android/tester: Add start device discovery " Jakub Tyszkowski
2013-12-19 12:42 ` [PATCH 4/6] android/tester: Add stop device discovery done " Jakub Tyszkowski
2013-12-19 12:42 ` [PATCH 5/6] android/tester: Add device discovery cancel success " Jakub Tyszkowski
2013-12-19 12:42 ` [PATCH 6/6] android/tester: Add start device discovery done " Jakub Tyszkowski
2013-12-19 13:42 ` [PATCH 1/6] android/tester: Fix for not checking for BT_STATUS_SUCCESS Johan Hedberg
2013-12-19 14:41   ` Tyszkowski Jakub
2013-12-19 14:42   ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox