New function ds_put_printable().
[sliver-openvswitch.git] / datapath / unit.h
1 #ifndef UNIT_H
2 #define UNIT_H 1
3
4 /* List of unit tests. */
5 #define UNIT_TESTS                              \
6         UNIT_TEST(table_t)                                        \
7         UNIT_TEST(crc_t)                                                \
8         UNIT_TEST(forward_t)
9
10 /* Prototype a function run_<NAME> for each of the unit tests. */
11 #define UNIT_TEST(NAME) void run_##NAME(void);
12 UNIT_TESTS
13 #undef UNIT_TEST
14
15 void unit_fail_function(const char *function, const char *msg, ...)
16         __attribute__((format(printf, 2, 3)));
17 #define unit_fail(...) unit_fail_function(__func__, __VA_ARGS__)
18
19 int unit_failed(void);
20
21 #endif /* unit.h */