From: Christian Herdtweck Date: Tue, 8 Nov 2016 09:02:06 +0000 (+0100) Subject: Fix unittests X-Git-Tag: v2.9~18 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=99e07fab5cb7fd958111c753df16cbc47e85ac2b;p=libi2ncommon Fix unittests --- diff --git a/test/stringfunc.cpp b/test/stringfunc.cpp index 49e44e0..fe50d4c 100644 --- a/test/stringfunc.cpp +++ b/test/stringfunc.cpp @@ -35,6 +35,7 @@ on this file might be covered by the GNU General Public License. #include #include #include +#include using namespace std; using namespace I2n; diff --git a/test/test_filefunc.cpp b/test/test_filefunc.cpp index 1a51769..1fb51f8 100644 --- a/test/test_filefunc.cpp +++ b/test/test_filefunc.cpp @@ -600,7 +600,7 @@ BOOST_AUTO_TEST_CASE(FreeDiskSpace1) int retries = 5; while (retries > 0) { - string dfstr=capture_exec("df -B 1 /tmp | tail -n 1 | sed -e \"s/[^ ]* *[^ ]* [^ ]* *\\([^ ]*\\).*/\\1/\""); + string dfstr=capture_exec("df -P -B 1 /tmp | tail -n 1 | sed \"s/ \\+/\\\\n/g\" | sed -n 4,4p"); dfout=-1; string_to(dfstr,dfout); @@ -663,6 +663,11 @@ BOOST_AUTO_TEST_CASE(TestDu) // Unlink it BOOST_CHECK_EQUAL(true, I2n::recursive_delete(unique_dir)); BOOST_CHECK_EQUAL(false, Stat(unique_dir).is_directory()); + + // remove links + unlink("hardlink1"); + unlink("hardlink2"); + unlink("hardlink3"); }