diff options
author | Jakub Tyszkowski <jakub.tyszkowski@tieto.com> | 2014-01-22 09:25:17 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@gmail.com> | 2014-01-23 23:42:29 +0100 |
commit | fddce77253c20f4d97e45a8fd5b6620f74f45742 (patch) | |
tree | 2d05a14da3bf2b5a31736d560faa2febcdcc066b /android/ipc-tester.c | |
parent | 2708345e29fe211246f4a43e44bd00cae8cd014e (diff) | |
download | bluez-fddce77253c20f4d97e45a8fd5b6620f74f45742.tar.gz |
android/ipc-tester: Add cases for HIDHOST msg size
Add cases testing message size verification for HIDHOST opcodes.
Diffstat (limited to 'android/ipc-tester.c')
-rw-r--r-- | android/ipc-tester.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/android/ipc-tester.c b/android/ipc-tester.c index 088c324a8..2871587a9 100644 --- a/android/ipc-tester.c +++ b/android/ipc-tester.c @@ -882,5 +882,79 @@ int main(int argc, char *argv[]) sizeof(struct hal_cmd_sock_connect), -1, HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCK); + /* check for valid data size for HID Host */ + test_datasize_valid("HIDHOST Connect+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_CONNECT, + sizeof(struct hal_cmd_hidhost_connect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Connect-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_CONNECT, + sizeof(struct hal_cmd_hidhost_connect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Disconnect+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_DISCONNECT, + sizeof(struct hal_cmd_hidhost_disconnect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Disconnect-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_DISCONNECT, + sizeof(struct hal_cmd_hidhost_disconnect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Virt. Unplug+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, + sizeof(struct hal_cmd_hidhost_virtual_unplug), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Virt. Unplug-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, + sizeof(struct hal_cmd_hidhost_virtual_unplug), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Info+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_INFO, + sizeof(struct hal_cmd_hidhost_set_info), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Info-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_INFO, + sizeof(struct hal_cmd_hidhost_set_info), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Protocol+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_get_protocol), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Protocol-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_get_protocol), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Protocol+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_set_protocol), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Protocol-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_set_protocol), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Report+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_REPORT, + sizeof(struct hal_cmd_hidhost_get_report), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Report-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_REPORT, + sizeof(struct hal_cmd_hidhost_get_report), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Report+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_REPORT, + sizeof(struct hal_cmd_hidhost_set_report), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Report-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_REPORT, + sizeof(struct hal_cmd_hidhost_set_report), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Send Data+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SEND_DATA, + sizeof(struct hal_cmd_hidhost_send_data), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Send Data-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SEND_DATA, + sizeof(struct hal_cmd_hidhost_send_data), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + return tester_run(); } |