kdbus: the driver, original and non-working
[platform/kernel/linux-rpi.git] / tools / testing / selftests / kdbus / kdbus-test.h
1 #ifndef _TEST_KDBUS_H_
2 #define _TEST_KDBUS_H_
3
4 struct kdbus_test_env {
5         char *buspath;
6         const char *root;
7         const char *module;
8         const char *mask_param_path;
9         int control_fd;
10         struct kdbus_conn *conn;
11 };
12
13 enum {
14         TEST_OK,
15         TEST_SKIP,
16         TEST_ERR,
17 };
18
19 #define ASSERT_RETURN_VAL(cond, val)            \
20         if (!(cond)) {                  \
21                 fprintf(stderr, "Assertion '%s' failed in %s(), %s:%d\n", \
22                         #cond, __func__, __FILE__, __LINE__);   \
23                 return val;     \
24         }
25
26 #define ASSERT_EXIT_VAL(cond, val)              \
27         if (!(cond)) {                  \
28                 fprintf(stderr, "Assertion '%s' failed in %s(), %s:%d\n", \
29                         #cond, __func__, __FILE__, __LINE__);   \
30                 _exit(val);     \
31         }
32
33 #define ASSERT_BREAK(cond)              \
34         if (!(cond)) {                  \
35                 fprintf(stderr, "Assertion '%s' failed in %s(), %s:%d\n", \
36                         #cond, __func__, __FILE__, __LINE__);   \
37                 break; \
38         }
39
40 #define ASSERT_RETURN(cond)             \
41         ASSERT_RETURN_VAL(cond, TEST_ERR)
42
43 #define ASSERT_EXIT(cond)               \
44         ASSERT_EXIT_VAL(cond, EXIT_FAILURE)
45
46 int kdbus_test_activator(struct kdbus_test_env *env);
47 int kdbus_test_attach_flags(struct kdbus_test_env *env);
48 int kdbus_test_benchmark(struct kdbus_test_env *env);
49 int kdbus_test_benchmark_nomemfds(struct kdbus_test_env *env);
50 int kdbus_test_benchmark_uds(struct kdbus_test_env *env);
51 int kdbus_test_bus_make(struct kdbus_test_env *env);
52 int kdbus_test_byebye(struct kdbus_test_env *env);
53 int kdbus_test_chat(struct kdbus_test_env *env);
54 int kdbus_test_conn_info(struct kdbus_test_env *env);
55 int kdbus_test_conn_update(struct kdbus_test_env *env);
56 int kdbus_test_daemon(struct kdbus_test_env *env);
57 int kdbus_test_custom_endpoint(struct kdbus_test_env *env);
58 int kdbus_test_fd_passing(struct kdbus_test_env *env);
59 int kdbus_test_free(struct kdbus_test_env *env);
60 int kdbus_test_hello(struct kdbus_test_env *env);
61 int kdbus_test_match_bloom(struct kdbus_test_env *env);
62 int kdbus_test_match_id_add(struct kdbus_test_env *env);
63 int kdbus_test_match_id_remove(struct kdbus_test_env *env);
64 int kdbus_test_match_replace(struct kdbus_test_env *env);
65 int kdbus_test_match_name_add(struct kdbus_test_env *env);
66 int kdbus_test_match_name_change(struct kdbus_test_env *env);
67 int kdbus_test_match_name_remove(struct kdbus_test_env *env);
68 int kdbus_test_message_basic(struct kdbus_test_env *env);
69 int kdbus_test_message_prio(struct kdbus_test_env *env);
70 int kdbus_test_message_quota(struct kdbus_test_env *env);
71 int kdbus_test_memory_access(struct kdbus_test_env *env);
72 int kdbus_test_metadata_ns(struct kdbus_test_env *env);
73 int kdbus_test_monitor(struct kdbus_test_env *env);
74 int kdbus_test_name_basic(struct kdbus_test_env *env);
75 int kdbus_test_name_conflict(struct kdbus_test_env *env);
76 int kdbus_test_name_queue(struct kdbus_test_env *env);
77 int kdbus_test_policy(struct kdbus_test_env *env);
78 int kdbus_test_policy_ns(struct kdbus_test_env *env);
79 int kdbus_test_policy_priv(struct kdbus_test_env *env);
80 int kdbus_test_send(struct kdbus_test_env *env);
81 int kdbus_test_sync_byebye(struct kdbus_test_env *env);
82 int kdbus_test_sync_reply(struct kdbus_test_env *env);
83 int kdbus_test_timeout(struct kdbus_test_env *env);
84 int kdbus_test_writable_pool(struct kdbus_test_env *env);
85
86 #endif /* _TEST_KDBUS_H_ */