This adds UUIDS set property fail test case due to only get
possibility.
---
android/android-tester.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 92e6080..0025f20 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -596,6 +596,18 @@ static const struct generic_data bluetooth_getprop_bdname_success_test = {
.expected_property.len = 17
};
+static unsigned char setprop_uuids[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00,
+ 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00 };
+
+static const struct generic_data bluetooth_setprop_uuid_invalid_test = {
+ .expected_hal_callbacks = {ADAPTER_TEST_END},
+ .expected_adapter_status = BT_STATUS_FAIL,
+ .expected_property.type = BT_PROPERTY_UUIDS,
+ .expected_property.val = &setprop_uuids,
+ .expected_property.len = sizeof(setprop_uuids)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -973,6 +985,19 @@ static void test_getprop_bdname_success(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_uuid_invalid(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -1028,6 +1053,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_getprop_bdname_success, teardown);
+ test_bredrle("Set UUID - Invalid",
+ &bluetooth_setprop_uuid_invalid_test,
+ setup_enabled_adapter,
+ test_setprop_uuid_invalid, teardown);
+
test_bredrle("Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
Hi Grzegorz,
On Wed, Dec 18, 2013 at 10:53:09AM +0100, Grzegorz Kolodziejczyk wrote:
> This adds UUIDS set property fail test case due to only get
> possibility.
> ---
> android/android-tester.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/android/android-tester.c b/android/android-tester.c
> index 92e6080..0025f20 100644
> --- a/android/android-tester.c
> +++ b/android/android-tester.c
> @@ -596,6 +596,18 @@ static const struct generic_data bluetooth_getprop_bdname_success_test = {
> .expected_property.len = 17
> };
>
> +static unsigned char setprop_uuids[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00,
> + 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
> + 0x00, 0x00 };
> +
> +static const struct generic_data bluetooth_setprop_uuid_invalid_test = {
> + .expected_hal_callbacks = {ADAPTER_TEST_END},
Do we agree to use spaces before and after braces?
Best regards
Andrei Emeltchenko
Hi Grzegorz,
On Wed, Dec 18, 2013, Grzegorz Kolodziejczyk wrote:
> This adds UUIDS set property fail test case due to only get
> possibility.
> ---
> android/android-tester.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
All five patches have been applied. Thanks.
Johan
This adds SERVICE_RECORD set property fail test case due to only
get possibility.
---
android/android-tester.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 9bae94d..3d439de 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -638,6 +638,21 @@ static const struct generic_data bluetooth_setprop_remote_rssi_invalid_test = {
.expected_property.len = sizeof(setprop_remote_rssi)
};
+static bt_service_record_t setprop_remote_service = {
+ .uuid = { {0x00} },
+ .channel = 12,
+ .name = "bt_name"
+};
+
+static const struct generic_data
+ bluetooth_setprop_service_record_invalid_test = {
+ .expected_hal_callbacks = {ADAPTER_TEST_END},
+ .expected_adapter_status = BT_STATUS_FAIL,
+ .expected_property.type = BT_PROPERTY_SERVICE_RECORD,
+ .expected_property.val = &setprop_remote_service,
+ .expected_property.len = sizeof(setprop_remote_service)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -1067,6 +1082,19 @@ static void test_setprop_rssi_invalid(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_service_record_invalid(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -1142,6 +1170,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_rssi_invalid, teardown);
+ test_bredrle("Set SERVICE_RECORD - Invalid",
+ &bluetooth_setprop_service_record_invalid_test,
+ setup_enabled_adapter,
+ test_setprop_service_record_invalid, teardown);
+
test_bredrle("Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
This adds CLASS_OF_DEVICE set property fail test case due to only
get possibility.
---
android/android-tester.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 0025f20..345d5c6 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -608,6 +608,16 @@ static const struct generic_data bluetooth_setprop_uuid_invalid_test = {
.expected_property.len = sizeof(setprop_uuids)
};
+static uint32_t setprop_class_of_device = 0;
+
+static const struct generic_data bluetooth_setprop_cod_invalid_test = {
+ .expected_hal_callbacks = {ADAPTER_TEST_END},
+ .expected_adapter_status = BT_STATUS_FAIL,
+ .expected_property.type = BT_PROPERTY_CLASS_OF_DEVICE,
+ .expected_property.val = &setprop_class_of_device,
+ .expected_property.len = sizeof(setprop_class_of_device)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -998,6 +1008,19 @@ static void test_setprop_uuid_invalid(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_cod_invalid(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -1058,6 +1081,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_uuid_invalid, teardown);
+ test_bredrle("Set CLASS_OF_DEVICE - Invalid",
+ &bluetooth_setprop_cod_invalid_test,
+ setup_enabled_adapter,
+ test_setprop_cod_invalid, teardown);
+
test_bredrle("Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
This adds RSSI set property fail test case due to be only remote device
property.
---
android/android-tester.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 2f2bbff..9bae94d 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -628,6 +628,16 @@ static const struct generic_data bluetooth_setprop_tod_invalid_test = {
.expected_property.len = sizeof(setprop_type_of_device)
};
+static int32_t setprop_remote_rssi = 0;
+
+static const struct generic_data bluetooth_setprop_remote_rssi_invalid_test = {
+ .expected_hal_callbacks = {ADAPTER_TEST_END},
+ .expected_adapter_status = BT_STATUS_FAIL,
+ .expected_property.type = BT_PROPERTY_REMOTE_RSSI,
+ .expected_property.val = &setprop_remote_rssi,
+ .expected_property.len = sizeof(setprop_remote_rssi)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -1044,6 +1054,19 @@ static void test_setprop_tod_invalid(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_rssi_invalid(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -1114,6 +1137,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_tod_invalid, teardown);
+ test_bredrle("Set REMOTE_RSSI - Invalid",
+ &bluetooth_setprop_remote_rssi_invalid_test,
+ setup_enabled_adapter,
+ test_setprop_rssi_invalid, teardown);
+
test_bredrle("Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2
This adds TYPE_OF_DEVICE set property fail test case due to only
get possibility.
---
android/android-tester.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 345d5c6..2f2bbff 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -618,6 +618,16 @@ static const struct generic_data bluetooth_setprop_cod_invalid_test = {
.expected_property.len = sizeof(setprop_class_of_device)
};
+static bt_device_type_t setprop_type_of_device = BT_DEVICE_DEVTYPE_BREDR;
+
+static const struct generic_data bluetooth_setprop_tod_invalid_test = {
+ .expected_hal_callbacks = {ADAPTER_TEST_END},
+ .expected_adapter_status = BT_STATUS_FAIL,
+ .expected_property.type = BT_PROPERTY_TYPE_OF_DEVICE,
+ .expected_property.val = &setprop_type_of_device,
+ .expected_property.len = sizeof(setprop_type_of_device)
+};
+
static bt_callbacks_t bt_callbacks = {
.size = sizeof(bt_callbacks),
.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -1021,6 +1031,19 @@ static void test_setprop_cod_invalid(const void *test_data)
check_expected_status(adapter_status);
}
+static void test_setprop_tod_invalid(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const struct generic_data *test = data->test_data;
+ const bt_property_t *prop = &test->expected_property;
+ bt_status_t adapter_status;
+
+ init_test_conditions(data);
+
+ adapter_status = data->if_bluetooth->set_adapter_property(prop);
+ check_expected_status(adapter_status);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -1086,6 +1109,11 @@ int main(int argc, char *argv[])
setup_enabled_adapter,
test_setprop_cod_invalid, teardown);
+ test_bredrle("Set TYPE_OF_DEVICE - Invalid",
+ &bluetooth_setprop_tod_invalid_test,
+ setup_enabled_adapter,
+ test_setprop_tod_invalid, teardown);
+
test_bredrle("Socket Init", NULL, setup_socket_interface,
test_dummy, teardown);
--
1.8.4.2