Module Name: src
Committed By: jruoho
Date: Fri Jul 15 07:39:26 UTC 2011
Modified Files:
src/tests/lib/libc/inet: t_inet_network.c
Log Message:
Split the test to two contextually different tests.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/inet/t_inet_network.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/inet/t_inet_network.c
diff -u src/tests/lib/libc/inet/t_inet_network.c:1.1 src/tests/lib/libc/inet/t_inet_network.c:1.2
--- src/tests/lib/libc/inet/t_inet_network.c:1.1 Thu Jan 13 13:53:49 2011
+++ src/tests/lib/libc/inet/t_inet_network.c Fri Jul 15 07:39:26 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_inet_network.c,v 1.1 2011/01/13 13:53:49 pgoyette Exp $ */
+/* $NetBSD: t_inet_network.c,v 1.2 2011/07/15 07:39:26 jruoho Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_inet_network.c,v 1.1 2011/01/13 13:53:49 pgoyette Exp $");
+__RCSID("$NetBSD: t_inet_network.c,v 1.2 2011/07/15 07:39:26 jruoho Exp $");
#include <arpa/inet.h>
@@ -43,15 +43,13 @@
"inet_network(%s) returned: 0x%08X, expected: %s", #input, \
inet_network(input), #expected)
-ATF_TC(inet_network);
-
-ATF_TC_HEAD(inet_network, tc)
+ATF_TC(inet_network_basic);
+ATF_TC_HEAD(inet_network_basic, tc)
{
-
atf_tc_set_md_var(tc, "descr", "Checks inet_network(3)");
}
-ATF_TC_BODY(inet_network, tc)
+ATF_TC_BODY(inet_network_basic, tc)
{
H_REQUIRE("0x12", 0x00000012);
@@ -63,10 +61,19 @@
H_REQUIRE("0x1.23.045.0", 0x01172500);
H_REQUIRE("0x12.0x34", 0x00001234);
- /* yes, this is valid (because of the trailing space after the digit) */
+ /* This is valid (because of the trailing space after the digit). */
H_REQUIRE("1 bar", 0x00000001);
+}
- /* malformed requests */
+ATF_TC(inet_network_err);
+ATF_TC_HEAD(inet_network_err, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks errors from inet_network(3)");
+}
+
+ATF_TC_BODY(inet_network_err, tc)
+{
+ /* Malformed requests. */
H_REQUIRE("4.2.3.1.", 0xffffffff);
H_REQUIRE("0x123456", 0xffffffff);
H_REQUIRE("0x12.0x345", 0xffffffff);
@@ -92,7 +99,8 @@
ATF_TP_ADD_TCS(tp)
{
- ATF_TP_ADD_TC(tp, inet_network);
+ ATF_TP_ADD_TC(tp, inet_network_basic);
+ ATF_TP_ADD_TC(tp, inet_network_err);
return atf_no_error();
}