aboutsummaryrefslogtreecommitdiff
path: root/tests/process
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-30 19:05:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-31 00:51:43 +0300
commitc7ec29b2d6a66700933ede6ae2371e1d54744d67 (patch)
tree119ff80f333892422e99cd352c99702f0ae7eb7c /tests/process
parent95ff8f359cfc2189bd4d7e02e15373027d2bda32 (diff)
Add ifdstream::read_text() and ifdstream::read_binary()
Diffstat (limited to 'tests/process')
-rw-r--r--tests/process/driver.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/process/driver.cxx b/tests/process/driver.cxx
index b154bce..4694d5b 100644
--- a/tests/process/driver.cxx
+++ b/tests/process/driver.cxx
@@ -94,9 +94,7 @@ exec (const path& p,
cwd, args.data (), pr, bin_mode (move (pr3.out_fd)).get (), -2);
ifdstream is (bin_mode (move (pr3.in_ofd)));
-
- o = vector<char> (
- (istreambuf_iterator<char> (is)), istreambuf_iterator<char> ());
+ o = is.read_binary ();
r = pr2.wait () && r;
r = pr3.wait () && r;
@@ -104,9 +102,7 @@ exec (const path& p,
else
{
ifdstream is (bin_mode (move (pr.in_ofd)));
-
- o = vector<char> (
- (istreambuf_iterator<char> (is)), istreambuf_iterator<char> ());
+ o = is.read_binary ();
}
if (err)
@@ -125,9 +121,7 @@ exec (const path& p,
if (err && !out)
{
ifdstream is (bin_mode (move (pr.in_efd)));
-
- vector<char> e
- ((istreambuf_iterator<char> (is)), istreambuf_iterator<char> ());
+ vector<char> e (is.read_binary ());
r = in == e && r;
}