Skip to content

Commit b4e7c3a

Browse files
committed
Change stat to iostat
1 parent 7b76756 commit b4e7c3a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/io/test_filesystem.f90

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ subroutine fs_run_invalid_command(error)
6767

6868
integer :: stat
6969

70-
call run("invalid_command", stat=stat)
70+
call run("invalid_command", iostat=stat)
7171
call check(error, stat, "Running an invalid command should fail.")
7272
end
7373

@@ -76,7 +76,7 @@ subroutine fs_run_with_invalid_option(error)
7676

7777
integer :: stat
7878

79-
call run("whoami -X", stat=stat)
79+
call run("whoami -X", iostat=stat)
8080
call check(error, stat, "Running a valid command with an invalid option should fail.")
8181
end
8282

@@ -85,7 +85,7 @@ subroutine fs_run_valid_command(error)
8585

8686
integer :: stat
8787

88-
call run("whoami", stat=stat)
88+
call run("whoami", iostat=stat)
8989
call check(error, stat, "Running a valid command should not fail.")
9090
end
9191

@@ -95,12 +95,12 @@ subroutine fs_list_dir_empty(error)
9595
integer :: stat
9696
type(string_type), allocatable :: files(:)
9797

98-
call run('rm -rf '//temp_list_dir, stat=stat)
98+
call run('rm -rf '//temp_list_dir, iostat=stat)
9999
if (stat /= 0) then
100100
call test_failed(error, "Removing directory '"//temp_list_dir//"' failed."); return
101101
end if
102102

103-
call run('mkdir '//temp_list_dir, stat=stat)
103+
call run('mkdir '//temp_list_dir, iostat=stat)
104104
if (stat /= 0) then
105105
call test_failed(error, "Creating directory '"//temp_list_dir//"' failed."); return
106106
end if
@@ -109,7 +109,7 @@ subroutine fs_list_dir_empty(error)
109109
call check(error, stat, "Listing the contents of an empty directory shouldn't fail.")
110110
call check(error, size(files) == 0, "The directory should be empty.")
111111

112-
call run('rm -rf '//temp_list_dir, stat=stat)
112+
call run('rm -rf '//temp_list_dir, iostat=stat)
113113
end
114114

115115
subroutine fs_list_dir_one_file(error)
@@ -120,17 +120,17 @@ subroutine fs_list_dir_one_file(error)
120120
type(string_type), allocatable :: files(:)
121121
character(*), parameter :: filename = 'abc.txt'
122122

123-
call run('rm -rf '//temp_list_dir, stat=stat)
123+
call run('rm -rf '//temp_list_dir, iostat=stat)
124124
if (stat /= 0) then
125125
call test_failed(error, "Removing directory '"//temp_list_dir//"' failed."); return
126126
end if
127127

128-
call run('mkdir '//temp_list_dir, stat=stat)
128+
call run('mkdir '//temp_list_dir, iostat=stat)
129129
if (stat /= 0) then
130130
call test_failed(error, "Creating directory '"//temp_list_dir//"' failed."); return
131131
end if
132132

133-
call run('touch '//temp_list_dir//'/'//filename, stat=stat)
133+
call run('touch '//temp_list_dir//'/'//filename, iostat=stat)
134134
if (stat /= 0) then
135135
call test_failed(error, "Creating file'"//filename//"' in directory '"//temp_list_dir//"' failed."); return
136136
end if
@@ -140,7 +140,7 @@ subroutine fs_list_dir_one_file(error)
140140
call check(error, size(files) == 1, "The directory should contain one file.")
141141
call check(error, char(files(1)) == filename, "The file should be '"//filename//"'.")
142142

143-
call run('rm -rf '//temp_list_dir, stat=stat)
143+
call run('rm -rf '//temp_list_dir, iostat=stat)
144144
end
145145

146146
subroutine fs_list_dir_two_files(error)
@@ -152,22 +152,22 @@ subroutine fs_list_dir_two_files(error)
152152
character(*), parameter :: filename1 = 'abc.txt'
153153
character(*), parameter :: filename2 = 'xyz'
154154

155-
call run('rm -rf '//temp_list_dir, stat=stat)
155+
call run('rm -rf '//temp_list_dir, iostat=stat)
156156
if (stat /= 0) then
157157
call test_failed(error, "Removing directory '"//temp_list_dir//"' failed."); return
158158
end if
159159

160-
call run('mkdir '//temp_list_dir, stat=stat)
160+
call run('mkdir '//temp_list_dir, iostat=stat)
161161
if (stat /= 0) then
162162
call test_failed(error, "Creating directory '"//temp_list_dir//"' failed."); return
163163
end if
164164

165-
call run('touch '//temp_list_dir//'/'//filename1, stat=stat)
165+
call run('touch '//temp_list_dir//'/'//filename1, iostat=stat)
166166
if (stat /= 0) then
167167
call test_failed(error, "Creating file 1 in directory '"//temp_list_dir//"' failed."); return
168168
end if
169169

170-
call run('touch '//temp_list_dir//'/'//filename2, stat=stat)
170+
call run('touch '//temp_list_dir//'/'//filename2, iostat=stat)
171171
if (stat /= 0) then
172172
call test_failed(error, "Creating file 2 in directory '"//temp_list_dir//"' failed."); return
173173
end if
@@ -178,7 +178,7 @@ subroutine fs_list_dir_two_files(error)
178178
call check(error, char(files(1)) == filename1, "The file should be '"//filename1//"'.")
179179
call check(error, char(files(2)) == filename2, "The file should be '"//filename2//"'.")
180180

181-
call run('rm -rf '//temp_list_dir, stat=stat)
181+
call run('rm -rf '//temp_list_dir, iostat=stat)
182182
end
183183

184184
subroutine delete_file(filename)

0 commit comments

Comments
 (0)