rename pipe_to_string() to capture_exec() and improve it's interface
[libi2ncommon] / test / test_filefunc.cpp
index d982b5a..3d74a9d 100644 (file)
@@ -592,7 +592,7 @@ BOOST_AUTO_TEST_CASE(FileContentDiffersEqualSize)
 
 BOOST_AUTO_TEST_CASE(FreeDiskSpace1)
 {
-    string dfstr=pipe_to_string("df -B 1 --output=avail /tmp | tail -n 1");
+    string dfstr=capture_exec("df -B 1 --output=avail /tmp | tail -n 1");
 
     long long dfout=-1;
     string_to<long long>(dfstr,dfout);
@@ -620,7 +620,7 @@ BOOST_AUTO_TEST_CASE(TestDu)
     BOOST_CHECK_EQUAL(true, I2n::mkdir(sub_dir));
     BOOST_CHECK_EQUAL(true, write_file(some_file, "foobar and some more data, even more that Tom would like to see in one line without linebreak but I still want to have it all here"));
 
-    string dustr=pipe_to_string(string("du --block-size=1 --sum ")+unique_dir+" | cut -f 1");
+    string dustr=capture_exec(string("du --block-size=1 --sum ")+unique_dir+" | cut -f 1");
     long long duout=-1;
     string_to<long long>(dustr,duout);