tests: add tests for empty string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Nov 2017 09:13:05 +0000 (18:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 28 Nov 2017 11:21:25 +0000 (20:21 +0900)
src/test/test-af-list.c
src/test/test-arphrd-list.c

index 6934549..2d42dc2 100644 (file)
@@ -46,6 +46,7 @@ int main(int argc, const char *argv[]) {
         assert_se(af_to_name(af_max()) == NULL);
         assert_se(af_to_name(-1) == NULL);
         assert_se(af_from_name("huddlduddl") == AF_UNSPEC);
+        assert_se(af_from_name("") == AF_UNSPEC);
 
         return 0;
 }
index 2949a8a..e503582 100644 (file)
@@ -46,6 +46,7 @@ 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("") == 0);
 
         return 0;
 }