summaryrefslogtreecommitdiff
path: root/android/test-ipc.c
diff options
context:
space:
mode:
authorJakub Tyszkowski <jakub.tyszkowski@tieto.com>2014-02-04 15:39:07 +0100
committerSzymon Janc <szymon.janc@gmail.com>2014-02-04 21:35:11 +0100
commitce6444c8bd1468c8028c8ccb41e7243ce9d2eb24 (patch)
tree7d4bed797d9f85feb206fbc1ddd5b61e0d134c44 /android/test-ipc.c
parentde260fd378d17ef539f30ebea74bffd1c60a135d (diff)
downloadbluez-ce6444c8bd1468c8028c8ccb41e7243ce9d2eb24.tar.gz
android/unit: Add negative case for msg size verification
Case for checking message size declared inside the header against the amount of data sent for variable sized message.
Diffstat (limited to 'android/test-ipc.c')
-rw-r--r--android/test-ipc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/test-ipc.c b/android/test-ipc.c
index 6bb6cd609..e4463ebd2 100644
--- a/android/test-ipc.c
+++ b/android/test-ipc.c
@@ -499,6 +499,15 @@ static const struct test_data test_cmd_vardata_valid_2 = {
.handlers_size = 1,
};
+static const struct test_data test_cmd_vardata_invalid_1 = {
+ .cmd = &test_cmd_vardata,
+ .cmd_size = sizeof(struct hal_hdr) + sizeof(VARDATA_EX1) - 1,
+ .service = 0,
+ .handlers = cmd_vardata_handlers,
+ .handlers_size = 1,
+ .expected_signal = SIGTERM
+};
+
static const struct hal_hdr test_cmd_service_offrange_hdr = {
.service_id = HAL_SERVICE_ID_MAX + 1,
.opcode = 1,
@@ -541,6 +550,9 @@ int main(int argc, char *argv[])
g_test_add_data_func("/android_ipc/test_cmd_vardata_valid_2",
&test_cmd_vardata_valid_2,
test_cmd_reg);
+ g_test_add_data_func("/android_ipc/test_cmd_vardata_invalid_1",
+ &test_cmd_vardata_invalid_1,
+ test_cmd_reg);
g_test_add_data_func("/android_ipc/test_cmd_service_offrange",
&test_cmd_service_offrange,
test_cmd_reg);