]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/test/test-arphrd-util.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 #include <linux/if_arp.h>
5 #include "arphrd-util.h"
6 #include "string-util.h"
10 for (int i
= 0; i
<= ARPHRD_VOID
+ 1; i
++) {
13 name
= arphrd_to_name(i
);
15 log_info("%i: %s", i
, name
);
17 assert_se(arphrd_from_name(name
) == i
);
21 assert_se(arphrd_to_name(ARPHRD_VOID
+ 1) == NULL
);
22 assert_se(arphrd_from_name("huddlduddl") == -EINVAL
);
23 assert_se(arphrd_from_name("") == -EINVAL
);
26 DEFINE_TEST_MAIN(LOG_INFO
);