Add distribution specific package installation instructions
[tinc] / test / unit / test_protocol.c
1 #include "unittest.h"
2 #include "../../src/protocol.h"
3
4 static void test_get_invalid_request(void **state) {
5         (void)state;
6
7         assert_null(get_request_entry(ALL));
8         assert_null(get_request_entry(LAST));
9 }
10
11 static void test_get_valid_request_returns_nonnull(void **state) {
12         (void)state;
13
14         for(request_t req = ID; req < LAST; ++req) {
15                 const request_entry_t *ent = get_request_entry(req);
16                 assert_non_null(ent);
17                 assert_non_null(ent->name);
18         }
19 }
20
21 int main(void) {
22         const struct CMUnitTest tests[] = {
23                 cmocka_unit_test(test_get_invalid_request),
24                 cmocka_unit_test(test_get_valid_request_returns_nonnull),
25         };
26         return cmocka_run_group_tests(tests, NULL, NULL);
27 }