[PATCH 7/7] android/tester: Add SERVICE_RECORD set prop fail test case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 c260a69..2c1a089 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(int32_t)
 };
 
+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(bt_service_record_t)
+};
+
 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(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, teardown);
+
 	test_bredrle("Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux