projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ldexpl; Update regarding AIX.
[gnulib.git]
/
tests
/
test-pipe-filter-ii1.c
diff --git
a/tests/test-pipe-filter-ii1.c
b/tests/test-pipe-filter-ii1.c
index
016c042
..
58cc192
100644
(file)
--- a/
tests/test-pipe-filter-ii1.c
+++ b/
tests/test-pipe-filter-ii1.c
@@
-1,5
+1,5
@@
/* Test of filtering of data through a subprocess.
/* Test of filtering of data through a subprocess.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009
, 2010
Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2009.
This program is free software: you can redistribute it and/or modify
Written by Bruno Haible <haible@clisp.cons.org>, 2009.
This program is free software: you can redistribute it and/or modify
@@
-19,25
+19,11
@@
#include "pipe-filter.h"
#include "pipe-filter.h"
-#include <stdio.h>
-#include <stdlib.h>
-
#include "binary-io.h"
#include "c-ctype.h"
#include "read-file.h"
#include "progname.h"
#include "binary-io.h"
#include "c-ctype.h"
#include "read-file.h"
#include "progname.h"
-
-#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
- fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
- while (0)
+#include "macros.h"
/* Pipe a text file through 'tr a-z A-Z', which converts ASCII characters from
/* Pipe a text file through 'tr a-z A-Z', which converts ASCII characters from
@@
-92,12
+78,12
@@
done_read (void *data_read, size_t num_bytes_read, void *private_data)
{
/* Handle conversion NL -> CRLF possibly done by the child process. */
if (!(O_BINARY && *q == '\r'))
{
/* Handle conversion NL -> CRLF possibly done by the child process. */
if (!(O_BINARY && *q == '\r'))
- {
- char orig = *p;
- char expected = c_toupper (orig);
- ASSERT (*q == expected);
- p++;
- }
+
{
+
char orig = *p;
+
char expected = c_toupper (orig);
+
ASSERT (*q == expected);
+
p++;
+
}
}
l->nread = p - l->input;
}
}
l->nread = p - l->input;
}
@@
-138,9
+124,9
@@
main (int argc, char *argv[])
argv[3] = NULL;
result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true,
argv[3] = NULL;
result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true,
- prepare_write, done_write,
- prepare_read, done_read,
- &l);
+
prepare_write, done_write,
+
prepare_read, done_read,
+
&l);
ASSERT (result == 0);
ASSERT (l.nwritten == input_size);
ASSERT (l.nread == input_size);
ASSERT (result == 0);
ASSERT (l.nwritten == input_size);
ASSERT (l.nread == input_size);