Linux bluetooth development
 help / color / mirror / Atom feed
From: Tyszkowski Jakub <jakub.tyszkowski@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/6] android/tester: Fix for not checking for BT_STATUS_SUCCESS
Date: Thu, 19 Dec 2013 15:41:57 +0100	[thread overview]
Message-ID: <52B305B5.9020003@tieto.com> (raw)
In-Reply-To: <20131219134224.GA23417@x220.p-661hnu-f1>

On 12/19/2013 02:42 PM, Johan Hedberg wrote:
> Hi Jakub,
>
> On Thu, Dec 19, 2013, Jakub Tyszkowski wrote:
>> 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;
>>   }
>
> I suppose it does make sense to have such a special value, but I can't
> see you use it anywhere in your patch set. So I'd postpone this patch
> until you've got some actual code that needs it.
>
> Johan
>
But this will actually leave the tester not checking for 
BT_STATUS_SUCCESS (0 in enum) at all during real tests, as it is already 
being set as checked during the expected_status_init() call.

  reply	other threads:[~2013-12-19 14:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-12-19 14:42   ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52B305B5.9020003@tieto.com \
    --to=jakub.tyszkowski@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox