xalloc-die-tests: optimize
authorEric Blake <ebb9@byu.net>
Tue, 17 Nov 2009 18:38:42 +0000 (11:38 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 18 Nov 2009 05:12:01 +0000 (22:12 -0700)
* tests/test-xalloc-die.sh: Reduce number of processes.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
tests/test-xalloc-die.sh

index 33e9351..2889727 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-17  Eric Blake  <ebb9@byu.net>
+
+       xalloc-die-tests: optimize
+       * tests/test-xalloc-die.sh: Reduce number of processes.
+
 2009-11-17  Simon Josefsson  <simon@josefsson.org>
 
        * gnulib-tool: Support LGPLv3+ licenses in module files.  Tiny
index dc9bc37..4b0d2c2 100755 (executable)
@@ -30,7 +30,7 @@ fi
 
 tmpout=t-xalloc-die.tmp-stderr
 tmperr=t-xalloc-die.tmp-stdout
-tmpfiles="$tmpout $tmperr ${tmpout}2 ${tmperr}2"
+tmpfiles="$tmpout $tmperr ${tmperr}2"
 
 PATH=".:$PATH"
 export PATH
@@ -40,15 +40,13 @@ case $? in
   *) (exit 1); exit 1 ;;
 esac
 
-cat $tmperr | tr -d '\015' > ${tmperr}2
-cat $tmpout | tr -d '\015' > ${tmpout}2
+tr -d '\015' < $tmperr > ${tmperr}2 || { (exit 1); exit 1; }
 
 compare - ${tmperr}2 <<\EOF || { (exit 1); exit 1; }
 test-xalloc-die: memory exhausted
 EOF
 
-compare - ${tmpout}2 <<\EOF || { (exit 1); exit 1; }
-EOF
+test -s $tmpout && { (exit 1); exit 1; }
 
 rm -fr $tmpfiles