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 #define METHOD_SYSNOTI_GETREVISION "GetRevision"
23 static bool get_sysnoti_revision()
29 err = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
31 DEVICED_INTERFACE_SYSNOTI,
32 METHOD_SYSNOTI_GETREVISION, NULL, &msg);
34 _E("fail : no reply");
38 if (!g_variant_get_safe(msg, "(i)", &val))
39 _E("fail : no message");
41 if ((val == -ENOTSUP) || (val == -ENOSYS)) {
42 _I("Not supported feature! : %d", val);
45 _E("fail : returned fail (%d)", val);
47 _I("success : %d", val);
56 void proc_test_all(int *success, int *fail)
61 (get_sysnoti_revision()) ? s++ : f++;
63 if (NULL != success) *success = s;
64 if (NULL != fail) *fail = f;
67 static void proc_init(void *data)
74 proc_test_all(&success, &fail);
76 _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
79 static void proc_exit(void *data)
84 static int proc_unit(int argc, char **argv)
91 proc_test_all(&success, &fail);
92 _I("Total: %d, Success: %d, Fail: %d", success+fail, success, fail);
93 } else if (0 == strcmp(argv[3], METHOD_SYSNOTI_GETREVISION)) {
94 get_sysnoti_revision();
96 _E("Unknown test case!!!");
102 static const struct test_ops proc_test_ops = {
103 .priority = TEST_PRIORITY_NORMAL,
110 TEST_OPS_REGISTER(&proc_test_ops)