From 38162812297034cc54af94e1f55fe7a8a1688e9f Mon Sep 17 00:00:00 2001 From: Daniel Aarno Date: Wed, 15 Aug 2012 23:47:54 +0200 Subject: [PATCH] Actually test StringLikeTrait --- examples/test14.cpp | 2 +- tests/Makefile.am | 8 ++++++-- tests/runtests.sh | 2 +- tests/test86.out | 1 + tests/test86.sh | 9 +++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 tests/test86.out create mode 100644 tests/test86.sh diff --git a/examples/test14.cpp b/examples/test14.cpp index e194845..6f206e8 100644 --- a/examples/test14.cpp +++ b/examples/test14.cpp @@ -31,7 +31,7 @@ struct Vect : public TCLAP::StringLikeTrait { std::ostream& print(std::ostream &os) const { - std::copy(v, v + LEN, std::ostream_iterator(os, " ")); + std::copy(v, v + LEN, std::ostream_iterator(os, ", ")); return os; } diff --git a/tests/Makefile.am b/tests/Makefile.am index f354178..ff56583 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -83,7 +83,9 @@ TESTS = test1.sh \ test81.sh \ test82.sh \ test83.sh \ - test84.sh + test84.sh \ + test85.sh \ + test86.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -169,6 +171,8 @@ EXTRA_DIST = $(TESTS) \ test81.out \ test82.out \ test83.out \ - test84.out + test84.out \ + test85.out \ + test86.out CLEANFILES = tmp.out diff --git a/tests/runtests.sh b/tests/runtests.sh index c8ad90a..841915c 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -6,7 +6,7 @@ cd $DIR let "suc = 0" let "fail = 0" -NUMTEST=85 +NUMTEST=86 for (( tno = 1 ; $tno <= $NUMTEST ; tno = $tno + 1 )); do ./testCheck.sh $tno diff --git a/tests/test86.out b/tests/test86.out new file mode 100644 index 0000000..b5588ec --- /dev/null +++ b/tests/test86.out @@ -0,0 +1 @@ +3.2, -47.11, 0, diff --git a/tests/test86.sh b/tests/test86.sh new file mode 100644 index 0000000..d1cfa3a --- /dev/null +++ b/tests/test86.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +../examples/test14 -v "3.2 -47.11 0" > tmp.out 2>&1 + +if cmp -s tmp.out $srcdir/test86.out; then + exit 0 +else + exit 1 +fi