aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-06 11:15:28 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-06 11:15:28 +0000
commitd30e4cd074b8952e2be14ab4115fc9cf343225c5 (patch)
tree046093d37983f658bde36da5627a55ed4d670779
parenta9536c8114fb5efbb18bd391a03cd65ffb93d6b4 (diff)
downloadpaludis-d30e4cd074b8952e2be14ab4115fc9cf343225c5.tar.gz
paludis-d30e4cd074b8952e2be14ab4115fc9cf343225c5.tar.xz
Skip tests that rely upon -r files being unreadable if we're root
-rw-r--r--paludis/config_file_TEST.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/paludis/config_file_TEST.cc b/paludis/config_file_TEST.cc
index 8e972c1..eff7f15 100644
--- a/paludis/config_file_TEST.cc
+++ b/paludis/config_file_TEST.cc
@@ -24,6 +24,7 @@
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <vector>
+#include <unistd.h>
using namespace test;
using namespace paludis;
@@ -116,10 +117,13 @@ namespace test_cases
TestFile * f2(0);
TEST_CHECK_THROWS(f2 = new TestFile(ff2), ConfigFileError);
- FSEntry ff3("config_file_TEST_dir/unreadable_file");
- TEST_CHECK(ff3.is_regular_file());
- TestFile * f3(0);
- TEST_CHECK_THROWS(f3 = new TestFile(ff3), ConfigFileError);
+ if (0 != geteuid())
+ {
+ FSEntry ff3("config_file_TEST_dir/unreadable_file");
+ TEST_CHECK(ff3.is_regular_file());
+ TestFile * f3(0);
+ TEST_CHECK_THROWS(f3 = new TestFile(ff3), ConfigFileError);
+ }
}
} test_config_file_open_file;