diff options
author | Jakub Tyszkowski <jakub.tyszkowski@tieto.com> | 2014-02-04 15:39:02 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@gmail.com> | 2014-02-04 21:35:10 +0100 |
commit | 639abb4ba9cd632fd7775ed1fd6373a08f02e032 (patch) | |
tree | 238215aac6c6958c620c3ef0f4e60bce630ad434 /android/test-ipc.c | |
parent | e7a054a8b2e3ad1417497b79415d38ac974abc7c (diff) | |
download | bluez-639abb4ba9cd632fd7775ed1fd6373a08f02e032.tar.gz |
android/unit: Add case for opcode without handler
This test case checks if IPC shuts down on unhandled opcode.
Diffstat (limited to 'android/test-ipc.c')
-rw-r--r-- | android/test-ipc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/android/test-ipc.c b/android/test-ipc.c index 1e027fa72..cb6f5183f 100644 --- a/android/test-ipc.c +++ b/android/test-ipc.c @@ -445,6 +445,15 @@ static const struct test_data test_cmd_opcode_valid_2 = { .handlers_size = 2, }; +static const struct test_data test_cmd_opcode_invalid_1 = { + .cmd = &test_cmd_2_hdr, + .cmd_size = sizeof(test_cmd_2_hdr), + .service = 0, + .handlers = cmd_handlers, + .handlers_size = 1, + .expected_signal = SIGTERM +}; + int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); @@ -463,6 +472,9 @@ int main(int argc, char *argv[]) &test_cmd_opcode_valid_1, test_cmd_reg); g_test_add_data_func("/android_ipc/test_cmd_opcode_valid_2", &test_cmd_opcode_valid_2, test_cmd_reg); + g_test_add_data_func("/android_ipc/test_cmd_opcode_invalid_1", + &test_cmd_opcode_invalid_1, + test_cmd_reg); return g_test_run(); } |