summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/check-direct.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/check-direct.c b/tests/check-direct.c
index 8cb4932..df4933e 100644
--- a/tests/check-direct.c
+++ b/tests/check-direct.c
@@ -41,6 +41,15 @@ START_TEST(static_checks)
ck_assert_int_le(i, RTNL_LINK_STATS_MAX);
ck_assert_int_eq(i, rtnl_link_str2stat(s));
}
+
+ ck_assert_int_eq(nl_str2ip_proto(""), 0);
+ ck_assert_int_eq(nl_str2ip_proto("5"), 5);
+ ck_assert_int_eq(nl_str2ip_proto(" 13 "), -NLE_OBJ_NOTFOUND);
+ ck_assert_int_eq(nl_str2ip_proto("13"), 13);
+ ck_assert_int_eq(nl_str2ip_proto("0x13"), 0x13);
+ ck_assert_int_eq(nl_str2ip_proto("0342"), 0342);
+ ck_assert_int_eq(nl_str2ip_proto("2147483647"), 2147483647);
+ ck_assert_int_eq(nl_str2ip_proto("2147483648"), -2147483648);
}
END_TEST