]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added a regression test that checks if command line arguments with spaces work.
authorNicholas Nethercote <njn@valgrind.org>
Mon, 24 Feb 2003 22:05:38 +0000 (22:05 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 24 Feb 2003 22:05:38 +0000 (22:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1442

none/tests/Makefile.am
none/tests/args.c [new file with mode: 0644]
none/tests/args.stderr.exp [new file with mode: 0644]
none/tests/args.stderr.exp.hd [new file with mode: 0644]
none/tests/args.stdout.exp [new file with mode: 0644]
none/tests/args.vgtest [new file with mode: 0644]

index ed925e5e5c81ffe20101218239f2f72da4fd9a93..8d04c60f478bda5d9afea6721b7e29ba944117ce 100644 (file)
@@ -8,6 +8,7 @@ noinst_SCRIPTS = filter_stderr
 
 EXTRA_DIST = \
        $(noinst_SCRIPTS) \
+       args.stderr.exp args.stderr.exp.hd args.stdout.exp args.vgtest \
        bitfield1.stderr.exp bitfield1.stderr.exp.hd bitfield1.vgtest \
        bt_everything.stderr.exp bt_everything.stderr.exp.hd \
        bt_everything.stdout.exp bt_everything.vgtest \
@@ -42,7 +43,7 @@ EXTRA_DIST = \
        smc1.stderr.exp smc1.stderr.exp.hd smc1.stdout.exp smc1.vgtest
 
 noinst_PROGRAMS = \
-       bitfield1 bt_everything bt_literal coolo_strlen \
+       args bitfield1 bt_everything bt_literal coolo_strlen \
        cpuid dastest discard floored fork fucomip munmap_exe rcl_assert \
        rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
        pth_blockedsig \
@@ -52,6 +53,7 @@ CFLAGS   = $(WERROR) -Winline -Wall -Wshadow -g
 CXXFLAGS = $(CFLAGS)
 
 # generic C ones
+args_SOURCES           = args.c
 bitfield1_SOURCES      = bitfield1.c
 bt_everything_SOURCES  = bt_everything.c
 bt_literal_SOURCES     = bt_literal.c
diff --git a/none/tests/args.c b/none/tests/args.c
new file mode 100644 (file)
index 0000000..e7307a0
--- /dev/null
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int main(int argc, char* argv[])
+{
+   int i;
+
+   for (i = 0; i < argc; i++) {
+      printf("arg %d: `%s'\n", i, argv[i]);
+   }
+   return 0;
+}
diff --git a/none/tests/args.stderr.exp b/none/tests/args.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/args.stderr.exp.hd b/none/tests/args.stderr.exp.hd
new file mode 100644 (file)
index 0000000..c4aa6f0
--- /dev/null
@@ -0,0 +1,7 @@
+
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 0 bytes in 0 blocks.
+malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
+For a detailed leak analysis,  rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
diff --git a/none/tests/args.stdout.exp b/none/tests/args.stdout.exp
new file mode 100644 (file)
index 0000000..0d9db35
--- /dev/null
@@ -0,0 +1,4 @@
+arg 0: `./args'
+arg 1: `a'
+arg 2: `b'
+arg 3: `1 2 3'
diff --git a/none/tests/args.vgtest b/none/tests/args.vgtest
new file mode 100644 (file)
index 0000000..4b3529d
--- /dev/null
@@ -0,0 +1,2 @@
+prog: args
+args: a b "1 2 3"