INN commit: trunk (6 files)

INN Commit rra at isc.org
Wed Jan 16 21:54:43 UTC 2013


    Date: Wednesday, January 16, 2013 @ 13:54:43
  Author: iulius
Revision: 9457

test suite:  remove a useless wrapped test for setenv

Remove a test that makes the test suite fail on a few systems.
The code it is testing is obvious whereas getting the amount of
memory and the data size limits right is extremely difficult
in all cases.  Besides, this test does not serve much purpose
and is not present in rra-c-util 4.7.

Modified:
  trunk/MANIFEST
  trunk/support/mkmanifest
  trunk/tests/Makefile
  trunk/tests/lib/	(properties)
  trunk/tests/lib/setenv-t.c
Deleted:
  trunk/tests/lib/setenv.t

----------------------+
 MANIFEST             |    1 -
 support/mkmanifest   |    2 +-
 tests/Makefile       |    6 +++---
 tests/lib/setenv-t.c |   22 +---------------------
 tests/lib/setenv.t   |   17 -----------------
 5 files changed, 5 insertions(+), 43 deletions(-)

Modified: MANIFEST
===================================================================
--- MANIFEST	2013-01-16 19:29:51 UTC (rev 9456)
+++ MANIFEST	2013-01-16 21:54:43 UTC (rev 9457)
@@ -880,7 +880,6 @@
 tests/lib/pwrite-t.c                  Tests for lib/pwrite.c
 tests/lib/qio-t.c                     Tests for lib/qio.c
 tests/lib/setenv-t.c                  Tests for lib/setenv.c
-tests/lib/setenv.t                    Wrapper for setenv tests
 tests/lib/snprintf-t.c                Tests for lib/snprintf.c
 tests/lib/strlcat-t.c                 Tests for lib/strlcat.c
 tests/lib/strlcpy-t.c                 Tests for lib/strlcpy.c

Modified: support/mkmanifest
===================================================================
--- support/mkmanifest	2013-01-16 19:29:51 UTC (rev 9456)
+++ support/mkmanifest	2013-01-16 21:54:43 UTC (rev 9457)
@@ -284,7 +284,7 @@
 tests/lib/pread.t
 tests/lib/pwrite.t
 tests/lib/qio.t
-tests/lib/setenv.tr
+tests/lib/setenv.t
 tests/lib/snprintf.t
 tests/lib/strlcat.t
 tests/lib/strlcpy.t

Modified: tests/Makefile
===================================================================
--- tests/Makefile	2013-01-16 19:29:51 UTC (rev 9456)
+++ tests/Makefile	2013-01-16 21:54:43 UTC (rev 9457)
@@ -17,14 +17,14 @@
 	lib/hashtab.t lib/hex.t lib/inet_aton.t \
 	lib/inet_ntoa.t lib/inet_ntop.t lib/innconf.t lib/list.t lib/md5.t \
 	lib/memcmp.t lib/messages.t lib/mkstemp.t lib/network.t lib/pread.t \
-	lib/pwrite.t lib/qio.t lib/snprintf.t lib/strlcat.t \
+	lib/pwrite.t lib/qio.t lib/setenv.t lib/snprintf.t lib/strlcat.t \
 	lib/strlcpy.t lib/tst.t lib/uwildmat.t lib/vector.t lib/wire.t \
 	lib/xwrite.t nnrpd/auth-ext.t overview/api.t overview/buffindexed.t \
 	overview/tradindexed.t overview/xref.t util/innbind.t
 
 ##  Extra stuff that needs to be built before tests can be run.
 
-EXTRA	= runtests clients/server-list lib/setenv.tr lib/xmalloc
+EXTRA	= runtests clients/server-list lib/xmalloc
 
 all check test tests: $(TESTS) $(EXTRA)
 	./runtests TESTS
@@ -192,7 +192,7 @@
 lib/setenv.o: ../lib/setenv.c
 	$(CC) $(CFLAGS) -DTESTING -c -o $@ ../lib/setenv.c
 
-lib/setenv.tr: lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
+lib/setenv.t: lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
 	$(LINK) lib/setenv.o lib/setenv-t.o libtest.o $(LIBINN)
 
 lib/snprintf.o: ../lib/snprintf.c


Property changes on: trunk/tests/lib
___________________________________________________________________
Modified: svn:ignore
   - .libs
.pure
asprintf.t
buffer.t
concat.t
conffile.t
confparse.t
date.t
dispatch.t
getaddrinfo.t
getnameinfo.t
hash.t
hashtab.t
hex.t
hstrerror.t
inet_aton.t
inet_ntoa.t
inet_ntop.t
innconf.t
list.t
md5.t
memcmp.t
messages.t
mkstemp.t
network.t
pread.t
pwrite.t
qio.t
setenv.tr
snprintf.t
strlcat.t
strlcpy.t
tst.t
uwildmat.t
vector.t
wire.t
xmalloc
xwrite.t

   + .libs
.pure
asprintf.t
buffer.t
concat.t
conffile.t
confparse.t
date.t
dispatch.t
getaddrinfo.t
getnameinfo.t
hash.t
hashtab.t
hex.t
hstrerror.t
inet_aton.t
inet_ntoa.t
inet_ntop.t
innconf.t
list.t
md5.t
memcmp.t
messages.t
mkstemp.t
network.t
pread.t
pwrite.t
qio.t
setenv.t
snprintf.t
strlcat.t
strlcpy.t
tst.t
uwildmat.t
vector.t
wire.t
xmalloc
xwrite.t


Modified: tests/lib/setenv-t.c
===================================================================
--- tests/lib/setenv-t.c	2013-01-16 19:29:51 UTC (rev 9456)
+++ tests/lib/setenv-t.c	2013-01-16 21:54:43 UTC (rev 9457)
@@ -37,11 +37,8 @@
 int
 main(void)
 {
-    char *value;
-    int status;
+    plan(8);
 
-    plan(12);
-
     if (getenv(test_var))
         bail("%s already in the environment!", test_var);
 
@@ -54,22 +51,5 @@
     ok(test_setenv(test_var, "", 1) == 0, "overwrite with empty string");
     is_string("", getenv(test_var), "...and getenv correct");
 
-    /* We're run by a shell script wrapper that sets resource limits such
-     * that we can allocate one string of this size but not two.  Note that
-     * Linux doesn't support data limits, so skip if we get an unexpected
-     * success here.
-     */
-    value = xmalloc(100 * 1024);
-    memset(value, 'A', 100 * 1024 - 1);
-    value[100 * 1024 - 1] = 0;
-    ok(test_setenv(test_var, value, 0) == 0, "set string 3");
-    is_string("", getenv(test_var), "...and getenv empty");
-    status = test_setenv(test_var, value, 1);
-    if (status == 0) {
-        skip_block(2, "no data limit support");
-    } else {
-        ok((status == -1) && (errno == ENOMEM), "overwrite string 3");
-        is_string("", getenv(test_var), "...and getenv still empty");
-    }
     return 0;
 }

Deleted: tests/lib/setenv.t
===================================================================
--- tests/lib/setenv.t	2013-01-16 19:29:51 UTC (rev 9456)
+++ tests/lib/setenv.t	2013-01-16 21:54:43 UTC (rev 9457)
@@ -1,17 +0,0 @@
-#! /bin/sh
-# $Id$
-#
-# Wrapper around the setenv test suite to set a resource limit low enough
-# that two strings over 100KB can't both be allocated, allowing the memory
-# allocation failure code in setenv to be exercised.  Done with this
-# wrapper because ulimit is more easily portable than the corresponding C
-# code.
-
-# Find where the test suite is.
-setenv=setenv.tr
-for file in ./setenv.tr lib/setenv.tr tests/lib/setenv.tr ; do
-    [ -x $file ] && setenv=$file
-done
-
-ulimit -d 150
-exec $setenv



More information about the inn-committers mailing list