// ***************************************************************************** // // test rfcomm query tests // // ***************************************************************************** #include #include #include #include #include "CppUTest/TestHarness.h" #include "CppUTest/CommandLineTestRunner.h" #include "hci_cmd.h" #include "btstack_memory.h" #include "hci.h" #include "hci_dump.h" #include "ble/gatt_client.h" #include "ble/att_db.h" #include "profile.h" #include "expected_results.h" static uint16_t gatt_client_handle = 0x40; static int gatt_query_complete = 0; typedef enum { IDLE, DISCOVER_PRIMARY_SERVICES, DISCOVER_PRIMARY_SERVICE_WITH_UUID16, DISCOVER_PRIMARY_SERVICE_WITH_UUID128, DISCOVER_INCLUDED_SERVICE_FOR_SERVICE_WITH_UUID16, DISCOVER_INCLUDED_SERVICE_FOR_SERVICE_WITH_UUID128, DISCOVER_CHARACTERISTICS_FOR_SERVICE_WITH_UUID16, DISCOVER_CHARACTERISTICS_FOR_SERVICE_WITH_UUID128, DISCOVER_CHARACTERISTICS_BY_UUID16, DISCOVER_CHARACTERISTICS_BY_UUID128, DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID, READ_CHARACTERISTIC_VALUE, READ_LONG_CHARACTERISTIC_VALUE, WRITE_CHARACTERISTIC_VALUE, WRITE_LONG_CHARACTERISTIC_VALUE, DISCOVER_CHARACTERISTIC_DESCRIPTORS, READ_CHARACTERISTIC_DESCRIPTOR, WRITE_CHARACTERISTIC_DESCRIPTOR, WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION, READ_LONG_CHARACTERISTIC_DESCRIPTOR, WRITE_LONG_CHARACTERISTIC_DESCRIPTOR, WRITE_RELIABLE_LONG_CHARACTERISTIC_VALUE, WRITE_CHARACTERISTIC_VALUE_WITHOUT_RESPONSE } current_test_t; current_test_t test = IDLE; uint8_t characteristic_uuid128[] = {0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb}; uint16_t characteristic_uuid16 = 0xF000; static int result_index; static uint8_t result_counter; static gatt_client_service_t services[50]; static gatt_client_service_t included_services[50]; static gatt_client_characteristic_t characteristics[50]; static gatt_client_characteristic_descriptor_t descriptors[50]; void mock_simulate_discover_primary_services_response(void); void mock_simulate_att_exchange_mtu_response(void); void CHECK_EQUAL_ARRAY(const uint8_t * expected, uint8_t * actual, int size){ for (int i=0; i= buffer_size) blob_length = buffer_size; memcpy(buffer, &value[offset], blob_length); return blob_length; } extern "C" uint16_t att_read_callback(uint16_t handle, uint16_t attribute_handle, uint16_t offset, uint8_t * buffer, uint16_t buffer_size){ //printf("gatt client test, att_read_callback_t handle 0x%04x, offset %u, buffer %p, buffer_size %u\n", handle, offset, buffer, buffer_size); switch(test){ case READ_CHARACTERISTIC_DESCRIPTOR: case READ_CHARACTERISTIC_VALUE: result_counter++; if (buffer){ return copy_bytes((uint8_t *)short_value, short_value_length, offset, buffer, buffer_size); } return short_value_length; case READ_LONG_CHARACTERISTIC_DESCRIPTOR: case READ_LONG_CHARACTERISTIC_VALUE: result_counter++; if (buffer) { return copy_bytes((uint8_t *)long_value, long_value_length, offset, buffer, buffer_size); } return long_value_length; default: break; } return 0; } // static const char * decode_status(uint8_t status){ // switch (status){ // case 0: return "0"; // case GATT_CLIENT_IN_WRONG_STATE: return "GATT_CLIENT_IN_WRONG_STATE"; // case GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS: return "GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS"; // case GATT_CLIENT_NOT_CONNECTED: return "GATT_CLIENT_NOT_CONNECTED"; // case GATT_CLIENT_VALUE_TOO_LONG: return "GATT_CLIENT_VALUE_TOO_LONG"; // case GATT_CLIENT_BUSY: return "GATT_CLIENT_BUSY"; // case GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED: return "GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED"; // case GATT_CLIENTCHARACTERISTIC_INDICATION_NOT_SUPPORTED: return "GATT_CLIENTCHARACTERISTIC_INDICATION_NOT_SUPPORTED"; // } // } TEST_GROUP(GATTClient){ int acl_buffer_size; uint8_t acl_buffer[27]; uint8_t status; void setup(void){ result_counter = 0; result_index = 0; test = IDLE; } void reset_query_state(void){ gatt_query_complete = 0; result_counter = 0; result_index = 0; } }; TEST(GATTClient, TestDiscoverPrimaryServices){ test = DISCOVER_PRIMARY_SERVICES; reset_query_state(); status = gatt_client_discover_primary_services(handle_ble_client_event, gatt_client_handle); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); verify_primary_services(); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestDiscoverPrimaryServicesByUUID16){ test = DISCOVER_PRIMARY_SERVICE_WITH_UUID16; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(result_counter, 1); verify_primary_services_with_uuid16(); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestDiscoverPrimaryServicesByUUID128){ test = DISCOVER_PRIMARY_SERVICE_WITH_UUID128; status = gatt_client_discover_primary_services_by_uuid128(handle_ble_client_event, gatt_client_handle, primary_service_uuid128); CHECK_EQUAL(status, 0); CHECK_EQUAL(result_counter, 1); verify_primary_services_with_uuid128(); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestFindIncludedServicesForServiceWithUUID16){ test = DISCOVER_INCLUDED_SERVICE_FOR_SERVICE_WITH_UUID16; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); reset_query_state(); status = gatt_client_find_included_services_for_service(handle_ble_client_event, gatt_client_handle, &services[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); verify_included_services_uuid16(); } TEST(GATTClient, TestFindIncludedServicesForServiceWithUUID128){ test = DISCOVER_INCLUDED_SERVICE_FOR_SERVICE_WITH_UUID128; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid128(handle_ble_client_event, gatt_client_handle, primary_service_uuid128); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); reset_query_state(); status = gatt_client_find_included_services_for_service(handle_ble_client_event, gatt_client_handle, &services[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); verify_included_services_uuid128(); } TEST(GATTClient, TestDiscoverCharacteristicsForService){ test = DISCOVER_CHARACTERISTICS_FOR_SERVICE_WITH_UUID16; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service(handle_ble_client_event, gatt_client_handle, &services[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); verify_charasteristics(); } TEST(GATTClient, TestDiscoverCharacteristicsByUUID16){ test = DISCOVER_CHARACTERISTICS_BY_UUID16; reset_query_state(); status = gatt_client_discover_characteristics_for_handle_range_by_uuid16(handle_ble_client_event, gatt_client_handle, 0x30, 0x32, 0xF102); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestDiscoverCharacteristicsByUUID128){ test = DISCOVER_CHARACTERISTICS_BY_UUID128; reset_query_state(); status = gatt_client_discover_characteristics_for_handle_range_by_uuid128(handle_ble_client_event, gatt_client_handle, characteristic_handles[1][0], characteristic_handles[1][1], characteristic_uuids[1]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestDiscoverCharacteristics4ServiceByUUID128){ test = DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid128(handle_ble_client_event, gatt_client_handle, primary_service_uuid128); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); uint8_t characteristic_uuid[] = {0x00, 0x00, 0xF2, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; status = gatt_client_discover_characteristics_for_service_by_uuid128(handle_ble_client_event, gatt_client_handle, &services[0], characteristic_uuid); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF200); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestDiscoverCharacteristics4ServiceByUUID16){ test = DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); uint8_t characteristic_uuid[]= { 0x00, 0x00, 0xF1, 0x05, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; status = gatt_client_discover_characteristics_for_service_by_uuid128(handle_ble_client_event, gatt_client_handle, &services[0], characteristic_uuid); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestDiscoverCharacteristicDescriptor){ test = DISCOVER_CHARACTERISTIC_DESCRIPTORS; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristic_descriptors(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK(result_counter); CHECK_EQUAL(3, result_index); CHECK_EQUAL(0x2902, descriptors[0].uuid16); CHECK_EQUAL(0x2900, descriptors[1].uuid16); CHECK_EQUAL(0x2901, descriptors[2].uuid16); } TEST(GATTClient, TestWriteClientCharacteristicConfiguration){ test = WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_write_client_characteristic_configuration(handle_ble_client_event, gatt_client_handle, &characteristics[0], GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestReadCharacteristicDescriptor){ test = READ_CHARACTERISTIC_DESCRIPTOR; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristic_descriptors(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); reset_query_state(); status = gatt_client_read_characteristic_descriptor(handle_ble_client_event, gatt_client_handle, &descriptors[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); } TEST(GATTClient, TestReadCharacteristicValue){ test = READ_CHARACTERISTIC_VALUE; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_read_value_of_characteristic(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); } TEST(GATTClient, TestWriteCharacteristicValue){ test = WRITE_CHARACTERISTIC_VALUE; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_write_value_of_characteristic(handle_ble_client_event, gatt_client_handle, characteristics[0].value_handle, short_value_length, (uint8_t*)short_value); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestWriteCharacteristicDescriptor){ test = WRITE_CHARACTERISTIC_DESCRIPTOR; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristic_descriptors(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); reset_query_state(); status = gatt_client_write_characteristic_descriptor(handle_ble_client_event, gatt_client_handle, &descriptors[0], sizeof(indication), indication); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestReadLongCharacteristicValue){ test = READ_LONG_CHARACTERISTIC_VALUE; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_read_long_value_of_characteristic(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 7); } TEST(GATTClient, TestReadLongCharacteristicDescriptor){ test = READ_LONG_CHARACTERISTIC_DESCRIPTOR; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid128(handle_ble_client_event, gatt_client_handle, primary_service_uuid128); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF200); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristic_descriptors(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); reset_query_state(); result_counter = 0; status = gatt_client_read_long_characteristic_descriptor(handle_ble_client_event, gatt_client_handle, &descriptors[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 7); } TEST(GATTClient, TestWriteLongCharacteristicDescriptor){ test = WRITE_LONG_CHARACTERISTIC_DESCRIPTOR; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid128(handle_ble_client_event, gatt_client_handle, primary_service_uuid128); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF200); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristic_descriptors(handle_ble_client_event, gatt_client_handle, &characteristics[0]); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 3); result_counter = 0; status = gatt_client_write_long_characteristic_descriptor(handle_ble_client_event, gatt_client_handle, &descriptors[0], sizeof(long_value), (uint8_t *)long_value); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); } TEST(GATTClient, TestWriteLongCharacteristicValue){ test = WRITE_LONG_CHARACTERISTIC_VALUE; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_write_long_value_of_characteristic(handle_ble_client_event, gatt_client_handle, characteristics[0].value_handle, long_value_length, (uint8_t*)long_value); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); } TEST(GATTClient, TestWriteReliableLongCharacteristicValue){ test = WRITE_RELIABLE_LONG_CHARACTERISTIC_VALUE; reset_query_state(); status = gatt_client_discover_primary_services_by_uuid16(handle_ble_client_event, gatt_client_handle, service_uuid16); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_discover_characteristics_for_service_by_uuid16(handle_ble_client_event, gatt_client_handle, &services[0], 0xF100); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); CHECK_EQUAL(result_counter, 1); reset_query_state(); status = gatt_client_reliable_write_long_value_of_characteristic(handle_ble_client_event, gatt_client_handle, characteristics[0].value_handle, long_value_length, (uint8_t*)long_value); CHECK_EQUAL(status, 0); CHECK_EQUAL(gatt_query_complete, 1); } int main (int argc, const char * argv[]){ att_set_db(profile_data); att_set_write_callback(&att_write_callback); att_set_read_callback(&att_read_callback); gatt_client_init(); return CommandLineTestRunner::RunAllTests(argc, argv); }