]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-arphrd-list.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include <linux/if_arp.h>
5 #include "string-util.h"
8 #include "arphrd-list.h"
10 int main(int argc
, const char *argv
[]) {
11 test_setup_logging(LOG_INFO
);
13 for (int i
= 0; i
<= ARPHRD_VOID
+ 1; i
++) {
16 name
= arphrd_to_name(i
);
18 log_info("%i: %s", i
, name
);
20 assert_se(arphrd_from_name(name
) == i
);
24 assert_se(arphrd_to_name(ARPHRD_VOID
+ 1) == NULL
);
25 assert_se(arphrd_from_name("huddlduddl") == -EINVAL
);
26 assert_se(arphrd_from_name("") == -EINVAL
);