tests: use SPDX identifiers
[urcu.git] / tests / unit / test_urcu_multiflavor_single_unit.c
1 // SPDX-FileCopyrightText: 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4
5 /*
6 * Userspace RCU library - test multiple RCU flavors into one program
7 */
8
9 #ifndef DYNAMIC_LINK_TEST
10 #define _LGPL_SOURCE
11 #endif
12
13 #include <urcu/urcu-mb.h>
14 #include <urcu/urcu-bp.h>
15 #include <urcu/urcu-memb.h>
16 #include <urcu/urcu-signal.h>
17 #include <urcu/urcu-qsbr.h>
18
19 #include <stdlib.h>
20 #include "tap.h"
21
22 static int test_mf_mb(void)
23 {
24 urcu_mb_register_thread();
25 urcu_mb_read_lock();
26 urcu_mb_read_unlock();
27 urcu_mb_synchronize_rcu();
28 urcu_mb_unregister_thread();
29 return 0;
30 }
31
32 static int test_mf_bp(void)
33 {
34 urcu_bp_register_thread();
35 urcu_bp_read_lock();
36 urcu_bp_read_unlock();
37 urcu_bp_synchronize_rcu();
38 urcu_bp_unregister_thread();
39 return 0;
40 }
41
42 static int test_mf_memb(void)
43 {
44 urcu_memb_register_thread();
45 urcu_memb_read_lock();
46 urcu_memb_read_unlock();
47 urcu_memb_synchronize_rcu();
48 urcu_memb_unregister_thread();
49 return 0;
50 }
51
52 static int test_mf_signal(void)
53 {
54 urcu_signal_register_thread();
55 urcu_signal_read_lock();
56 urcu_signal_read_unlock();
57 urcu_signal_synchronize_rcu();
58 urcu_signal_unregister_thread();
59 return 0;
60 }
61
62 static int test_mf_qsbr(void)
63 {
64 urcu_qsbr_register_thread();
65 urcu_qsbr_read_lock();
66 urcu_qsbr_read_unlock();
67 urcu_qsbr_synchronize_rcu();
68 urcu_qsbr_unregister_thread();
69 return 0;
70 }
71
72 int main(void)
73 {
74 plan_tests(5);
75
76 ok1(!test_mf_mb());
77 ok1(!test_mf_bp());
78 ok1(!test_mf_memb());
79 ok1(!test_mf_signal());
80 ok1(!test_mf_qsbr());
81
82 return exit_status();
83 }
This page took 0.033784 seconds and 5 git commands to generate.