[PATCH] Fortran testuite, fix for testcase open_errors
Wolfgang Gellerich
gellerich@de.ibm.com
Wed Apr 25 15:49:00 GMT 2007
Hi F90 friends!
Test case open_errors.f90 fails on s390, and while debugging I found
that the checks its performs should be improved. The program
frequently calls OPEN with incorrect parameters and then checks
whether the error message returned via iomsg is the expected text.
However, in our case the problem is that the system fails to recognize
one of the errors at all, thus not making an assignment to char
variable msg. This variable than keeps its former value which may or
may not match the subsequent test, or, after I had reduced the test
case, just contains garbage from memory.
My proposed extension is to first test the value returned from OPEN
via iostat, verify that the error itself has beed recognized, and to
check the message only then.
With best regards,
Wolfgang Gellerich
---
Dr. Wolfgang Gellerich
IBM Deutschland Entwicklung GmbH
Schönaicher Strasse 220
71032 Böblingen, Germany
Tel. +49 / 7031 / 162598
gellerich@de.ibm.com
=======================
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
-----------------------
Changelog:
2007-04-25 Wolfgang Gellerich <gellerich@de.ibm.com>
* gfortran.dg/open_errors.f90: Added if statements checking
the value of iostat.
-----------------------
Index: gfortran.dg/open_errors.f90
===================================================================
--- gfortran.dg/open_errors.f90 (Revision 124156)
+++ gfortran.dg/open_errors.f90 (Arbeitskopie)
@@ -7,11 +7,13 @@
close(77, status="keep")
msg=""
open(77,file=n,status="new", iomsg=msg, iostat=i)
+if (i == 0) call abort()
if (msg /= "File 'temptestfile' already exists") call abort()
open(77,file=n,status="old")
close(77, status="delete")
open(77,file=n,status="old", iomsg=msg, iostat=i)
+if (i == 0) call abort()
if (msg /= "File 'temptestfile' does not exist") call abort()
open(77,file="./", iomsg=msg, iostat=i)
@@ -22,6 +24,7 @@
if (i == 0) then
close(77, status="keep")
open(77,file=n, iomsg=msg, iostat=i, action="write")
+ if (i == 0) call abort()
if (msg /= "Permission denied trying to open file 'temptestfile'") call abort()
endif
More information about the Gcc-patches
mailing list