]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* stdio-common/Makefile: Add rules to build and run tst-setvbuf1.
authorUlrich Drepper <drepper@redhat.com>
Tue, 8 Jul 2008 16:32:55 +0000 (16:32 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 8 Jul 2008 16:32:55 +0000 (16:32 +0000)
* stdio-common/tst-setvbuf1.c: New file.
* stdio-common/tst-setvbuf1.expect: New file.

ChangeLog
stdio-common/Makefile
stdio-common/tst-setvbuf1.c [new file with mode: 0644]
stdio-common/tst-setvbuf1.expect [new file with mode: 0644]

index 3a9f983441b2e620b23b8a8a304c6d75e539cb33..96dcaad311f6eb97eb24026ebb1c40ba4d889bd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-07-08  Ulrich Drepper  <drepper@redhat.com>
 
+       * stdio-common/Makefile: Add rules to build and run tst-setvbuf1.
+       * stdio-common/tst-setvbuf1.c: New file.
+       * stdio-common/tst-setvbuf1.expect: New file.
+
        [BZ #6719]
        * libio/iosetvbuf.c (_IO_setvbuf): Correctly clear buffering flags
        when selecting fully-buffered stream.
index f8ae6f25d9359d82833d52d539c4fbf8509aba3f..944270dafefdd11842b0b630c0bfe860f2b9abff 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1991-2006, 2007, 2008 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -58,7 +58,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
         tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
         tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
         bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
-        scanf16 scanf17
+        scanf16 scanf17 tst-setvbuf1
 
 test-srcs = tst-unbputc tst-printf
 
@@ -130,3 +130,7 @@ bug15-ENV = LOCPATH=$(common-objpfx)localedata
 ifneq (,$(filter %REENTRANT, $(defines)))
 CPPFLAGS += -D_IO_MTSAFE_IO
 endif
+
+$(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
+       $(built-program-cmd) > $@ 2>&1
+       cmp tst-setvbuf1.expect $@
diff --git a/stdio-common/tst-setvbuf1.c b/stdio-common/tst-setvbuf1.c
new file mode 100644 (file)
index 0000000..2241093
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+  if (setvbuf (stderr, NULL, _IOFBF, BUFSIZ) != 0)
+    {
+      puts ("Set full buffer error.");
+      return 1;
+    }
+
+  fprintf (stderr, "Output #1 <stderr>.\n");
+  printf ("Output #2 <stdout>.\n");
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/stdio-common/tst-setvbuf1.expect b/stdio-common/tst-setvbuf1.expect
new file mode 100644 (file)
index 0000000..281c18c
--- /dev/null
@@ -0,0 +1,2 @@
+Output #2 <stdout>.
+Output #1 <stderr>.