4 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 static const struct device_change_type {
23 } device_change_types [] = {
28 static int test(int index)
35 param[0] = METHOD_SET_DEVICE;
37 param[2] = device_change_types[index].name;
38 param[3] = device_change_types[index].status;
40 msg = dbus_method_sync_with_reply(DEVICED_BUS_NAME,
42 DEVICED_INTERFACE_SYSNOTI,
43 METHOD_SET_DEVICE, "siss", param);
45 _E("fail : %s %s %s %s",
46 DEVICED_BUS_NAME, DEVICED_PATH_SYSNOTI, DEVICED_INTERFACE_SYSNOTI,
51 dbus_error_init(&err);
53 ret = dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &ret_val, DBUS_TYPE_INVALID);
55 _E("no message : [%s:%s]", err.name, err.message);
56 dbus_error_free(&err);
59 _I("%s %s", device_change_types[index].name, device_change_types[index].status);
60 dbus_message_unref(msg);
61 dbus_error_free(&err);
62 sleep(TEST_WAIT_TIME_INTERVAL);
66 static void unit(char *unit, char *status)
70 for (index = 0; index < ARRAY_SIZE(device_change_types); index++) {
71 if (strcmp(unit, device_change_types[index].name) != 0 ||
72 strcmp(status, device_change_types[index].status) != 0)
78 static void tvout_init(void *data)
83 for (index = 0; index < ARRAY_SIZE(device_change_types); index++)
87 static void tvout_exit(void *data)
92 static int tvout_unit(int argc, char **argv)
101 unit(argv[1], argv[2]);
106 static const struct test_ops tvout_test_ops = {
107 .priority = TEST_PRIORITY_NORMAL,
114 TEST_OPS_REGISTER(&tvout_test_ops)