From 99e07fab5cb7fd958111c753df16cbc47e85ac2b Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Tue, 8 Nov 2016 10:02:06 +0100 Subject: [PATCH] Fix unittests --- test/stringfunc.cpp | 1 + test/test_filefunc.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletions(-) 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"); } -- 1.7.1