aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-08-05 14:14:41 -0700
committerAnthony Pesch <inolen@gmail.com>2013-08-05 14:14:41 -0700
commitf739fc81c0d7ad4ed4c82598a21852dbad7ca357 (patch)
tree7e92dfa718b95156623e792b170488a098d319f8 /tests
parent4f95207941b870b949e75d6c8838f9474502fed5 (diff)
Removed USE_OLD_FS
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py4
-rw-r--r--tests/stat/test_chmod.c24
-rw-r--r--tests/stat/test_mknod.c5
-rw-r--r--tests/stat/test_stat.c3
-rw-r--r--tests/stdio/test_rename.c4
5 files changed, 0 insertions, 40 deletions
diff --git a/tests/runner.py b/tests/runner.py
index b57b209a..76841026 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3591,7 +3591,6 @@ Exiting setjmp function, level: 0, prev_jmp: -1
self.do_run(src, 'z:1*', force_c=True)
def test_rename(self):
- Building.COMPILER_TEST_OPTS += ['-DUSE_OLD_FS='+str(Settings.USE_OLD_FS)]
src = open(path_from_root('tests', 'stdio', 'test_rename.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
@@ -7220,17 +7219,14 @@ def process(filename):
self.do_run(src, 'success', force_c=True)
def test_stat(self):
- Building.COMPILER_TEST_OPTS += ['-DUSE_OLD_FS='+str(Settings.USE_OLD_FS)]
src = open(path_from_root('tests', 'stat', 'test_stat.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
def test_stat_chmod(self):
- Building.COMPILER_TEST_OPTS += ['-DUSE_OLD_FS='+str(Settings.USE_OLD_FS)]
src = open(path_from_root('tests', 'stat', 'test_chmod.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
def test_stat_mknod(self):
- Building.COMPILER_TEST_OPTS += ['-DUSE_OLD_FS='+str(Settings.USE_OLD_FS)]
src = open(path_from_root('tests', 'stat', 'test_mknod.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
diff --git a/tests/stat/test_chmod.c b/tests/stat/test_chmod.c
index 94e6c12b..cb84e028 100644
--- a/tests/stat/test_chmod.c
+++ b/tests/stat/test_chmod.c
@@ -55,11 +55,7 @@ void test() {
memset(&s, 0, sizeof s);
stat("file", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0222 | S_IFREG));
-#else
assert(s.st_mode == (0200 | S_IFREG));
-#endif
assert(s.st_ctime != lastctime);
//
@@ -73,11 +69,7 @@ void test() {
memset(&s, 0, sizeof s);
stat("file", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0000 | S_IFREG));
-#else
assert(s.st_mode == (0100 | S_IFREG));
-#endif
assert(s.st_ctime != lastctime);
//
@@ -94,11 +86,7 @@ void test() {
assert(!err);
memset(&s, 0, sizeof s);
stat("folder", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0222 | S_IFDIR));
-#else
assert(s.st_mode == (0300 | S_IFDIR));
-#endif
assert(s.st_ctime != lastctime);
//
@@ -109,11 +97,7 @@ void test() {
// make sure the file it references changed
stat("file-link", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0555 | S_IFREG));
-#else
assert(s.st_mode == (0400 | S_IFREG));
-#endif
// but the link didn't
lstat("file-link", &s);
@@ -127,19 +111,11 @@ void test() {
// make sure the file it references didn't change
stat("file-link", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0555 | S_IFREG));
-#else
assert(s.st_mode == (0400 | S_IFREG));
-#endif
// but the link did
lstat("file-link", &s);
-#if USE_OLD_FS
- assert(s.st_mode == (0555 | S_IFLNK));
-#else
assert(s.st_mode == (0500 | S_IFLNK));
-#endif
puts("success");
}
diff --git a/tests/stat/test_mknod.c b/tests/stat/test_mknod.c
index 4cff57d9..be1d0c39 100644
--- a/tests/stat/test_mknod.c
+++ b/tests/stat/test_mknod.c
@@ -52,15 +52,10 @@ void test() {
// mknod a character device
err = mknod("mknod-device", S_IFCHR | 0777, 123);
-#if USE_OLD_FS
- assert(err);
- assert(errno == EPERM);
-#else
assert(!err);
memset(&s, 0, sizeof s);
stat("mknod-device", &s);
assert(S_ISCHR(s.st_mode));
-#endif
#endif
diff --git a/tests/stat/test_stat.c b/tests/stat/test_stat.c
index 14e88370..6e220eb9 100644
--- a/tests/stat/test_stat.c
+++ b/tests/stat/test_stat.c
@@ -103,13 +103,10 @@ void test() {
assert(s.st_ino);
assert(S_ISCHR(s.st_mode));
assert(s.st_nlink);
-#if !USE_OLD_FS
- // old FS doesn't store proper device ids
#ifndef __APPLE__
// mac uses makedev(3, 2) for /dev/null
assert(s.st_rdev == makedev(1, 3));
#endif
-#endif
assert(!s.st_size);
assert(s.st_atime);
assert(s.st_mtime);
diff --git a/tests/stdio/test_rename.c b/tests/stdio/test_rename.c
index ddbcd339..20ffb513 100644
--- a/tests/stdio/test_rename.c
+++ b/tests/stdio/test_rename.c
@@ -56,7 +56,6 @@ void test() {
assert(err == -1);
assert(errno == EISDIR);
-#if !USE_OLD_FS
// can't overwrite a file with a folder
err = rename("dir", "file");
assert(err == -1);
@@ -71,19 +70,16 @@ void test() {
err = rename("dir", "dir-readonly/dir");
assert(err == -1);
assert(errno == EACCES);
-#endif
// source should not be ancestor of target
err = rename("dir", "dir/somename");
assert(err == -1);
assert(errno == EINVAL);
-#if !USE_OLD_FS
// target should not be an ancestor of source
err = rename("dir/subdir", "dir");
assert(err == -1);
assert(errno == ENOTEMPTY);
-#endif
// do some valid renaming
err = rename("dir/file", "dir/file1");