From a45b2ac992a12ccc0641ab08d5a99e2bb762ddf7 Mon Sep 17 00:00:00 2001 From: Ralf Kirchner Date: Fri, 15 Nov 2013 13:45:01 +0100 Subject: fsdosfsname01: Improve test for duplicate names --- testsuites/fstests/fsdosfsname01/init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 #include #include @@ -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 ); -- cgit v1.2.3