File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,21 +128,6 @@ pub unsafe fn test_fstat_1() {
128128 ) ;
129129 libc:: unlink ( path as * const i8 ) ;
130130}
131- pub unsafe fn test_mkdir_2 ( ) {
132- let mut path: * const u8 = ( b"/tmp/cpp2rust_mkdir_test_dir\0 " . as_ptr ( ) . cast_mut ( ) ) . cast_const ( ) ;
133- libc:: rmdir ( path as * const i8 ) ;
134- assert ! ( ( ( ( ( libc:: mkdir( path as * const i8 , 493_u32 as :: libc:: mode_t) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
135- let mut st: stat = std:: mem:: zeroed :: < stat > ( ) ;
136- assert ! ( ( ( ( ( libc:: stat( path as * const i8 , ( & mut st as * mut stat) ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
137- assert ! ( ( ( ( ( ( st. st_mode) & ( 61440_u32 ) ) == ( ( 16384 ) as u32 ) ) as i32 ) != 0 ) ) ;
138- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
139- assert ! (
140- ( ( ( ( libc:: mkdir( path as * const i8 , 493_u32 as :: libc:: mode_t) ) == ( -1_i32 ) ) as i32 ) != 0 )
141- ) ;
142- assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno( ) ) == ( 17 ) ) as i32 ) != 0 ) ) ;
143- assert ! ( ( ( ( ( libc:: rmdir( path as * const i8 ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
144- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
145- }
146131pub fn main ( ) {
147132 unsafe {
148133 std:: process:: exit ( main_0 ( ) as i32 ) ;
@@ -151,6 +136,5 @@ pub fn main() {
151136unsafe fn main_0 ( ) -> i32 {
152137 ( unsafe { test_stat_0 ( ) } ) ;
153138 ( unsafe { test_fstat_1 ( ) } ) ;
154- ( unsafe { test_mkdir_2 ( ) } ) ;
155139 return 0 ;
156140}
Original file line number Diff line number Diff line change @@ -31,23 +31,8 @@ static void test_fstat(void) {
3131 unlink (path );
3232}
3333
34- static void test_mkdir (void ) {
35- const char * path = "/tmp/cpp2rust_mkdir_test_dir" ;
36- rmdir (path );
37- assert (mkdir (path , 0755 ) == 0 );
38- struct stat st ;
39- assert (stat (path , & st ) == 0 );
40- assert (S_ISDIR (st .st_mode ));
41- errno = 0 ;
42- assert (mkdir (path , 0755 ) == -1 );
43- assert (errno == EEXIST );
44- assert (rmdir (path ) == 0 );
45- errno = 0 ;
46- }
47-
4834int main (void ) {
4935 test_stat ();
5036 test_fstat ();
51- test_mkdir ();
5237 return 0 ;
5338}
You can’t perform that action at this time.
0 commit comments