diff options
author | Ralf Kirchner <ralf.kirchner@embedded-brains.de> | 2013-11-15 13:45:01 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-11-15 14:05:59 +0100 |
commit | a45b2ac992a12ccc0641ab08d5a99e2bb762ddf7 (patch) | |
tree | 440b92608ec56a6684b2d2e07257610745d25ecd /testsuites | |
parent | no_cpu/.../cpu.h: Comment improvement (diff) | |
download | rtems-a45b2ac992a12ccc0641ab08d5a99e2bb762ddf7.tar.bz2 |
fsdosfsname01: Improve test for duplicate names
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/fstests/fsdosfsname01/init.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/testsuites/fstests/fsdosfsname01/init.c b/testsuites/fstests/fsdosfsname01/init.c index 2d3348efd4..72de7d94e9 100644 --- a/testsuites/fstests/fsdosfsname01/init.c +++ b/testsuites/fstests/fsdosfsname01/init.c @@ -19,6 +19,7 @@ #include "tmacros.h" +#include <errno.h> #include <fcntl.h> #include <dirent.h> @@ -459,8 +460,10 @@ static void test_creating_duplicate_directories( ++index_duplicate ) { snprintf( dirname, sizeof( dirname ), "%s/%s", start_dir, duplicates[index_dir].name_duplicates[index_duplicate] ); + errno = 0; rc = mkdir( dirname, S_IRWXU | S_IRWXG | S_IRWXO ); - rtems_test_assert( rc < 0 ); + rtems_test_assert( rc == -1 ); + rtems_test_assert( errno == EEXIST ); } } } @@ -608,6 +611,11 @@ static void test_duplicated_files( const char *dirname, rc = close( fd ); rtems_test_assert( rc == 0 ); + + errno = 0; + fd = open( filename, O_RDWR | O_CREAT | O_EXCL ); + rtems_test_assert( fd == -1 ); + rtems_test_assert( errno == EEXIST ); } rc = remove( filename ); |