]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-arphrd-list.c
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / test / test-arphrd-list.c
index f3989ad201ac42b132cbd68c9ed894a54d83249c..3005fc1b696bc47eb151d0f1154871c25bb158e8 100644 (file)
@@ -1,30 +1,14 @@
-/***
-  This file is part of systemd
-
-  Copyright 2015 Daniel Mack
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
+/* SPDX-License-Identifier: LGPL-2.1+ */
 
 #include <net/if_arp.h>
 #include <string.h>
 
 #include "macro.h"
+#include "missing_network.h"
 #include "string-util.h"
-#include "util.h"
 
-static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
+_unused_ \
+static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
 
 #include "arphrd-from-name.h"
 #include "arphrd-list.h"
@@ -32,7 +16,7 @@ static const struct arphrd_name* lookup_arphrd(register const char *str, registe
 
 int main(int argc, const char *argv[]) {
 
-        unsigned int i;
+        unsigned i;
 
         for (i = 1; i < ELEMENTSOF(arphrd_names); i++) {
                 if (arphrd_names[i]) {
@@ -43,7 +27,8 @@ int main(int argc, const char *argv[]) {
 
         assert_se(arphrd_to_name(arphrd_max()) == NULL);
         assert_se(arphrd_to_name(0) == NULL);
-        assert_se(arphrd_from_name("huddlduddl") == 0);
+        assert_se(arphrd_from_name("huddlduddl") == -EINVAL);
+        assert_se(arphrd_from_name("") == -EINVAL);
 
         return 0;
 }