X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffopen.c;h=e15338319ac07cf8ee3025fefda51be1da36ab7b;hb=efc96bda49dee3cfdc433ae5bda80db96b99f963;hp=14ce3a8f57b2fe8911baba2c941f0529c76050a0;hpb=d9e48b611b63bcfc55727463cb9d9d0e87a7a405;p=pdclib diff --git a/functions/stdio/fopen.c b/functions/stdio/fopen.c index 14ce3a8..e153383 100644 --- a/functions/stdio/fopen.c +++ b/functions/stdio/fopen.c @@ -53,13 +53,23 @@ fail: int main( void ) { + /* Some of the tests are not executed for regression tests, as the libc on + my system is at once less forgiving (segfaults on mode NULL) and more + forgiving (accepts undefined modes). + */ +#ifndef REGTEST TESTCASE( fopen( NULL, NULL ) == NULL ); +#endif TESTCASE( fopen( NULL, "w" ) == NULL ); +#ifndef REGTEST TESTCASE( fopen( "", NULL ) == NULL ); +#endif TESTCASE( fopen( "", "w" ) == NULL ); TESTCASE( fopen( "foo", "" ) == NULL ); - TESTCASE( fopen( "testfile", "wq" ) == NULL ); /* Illegal mode */ - TESTCASE( fopen( "testfile", "wr" ) == NULL ); /* Illegal mode */ +#ifndef REGTEST + TESTCASE( fopen( "testfile", "wq" ) == NULL ); /* Undefined mode */ + TESTCASE( fopen( "testfile", "wr" ) == NULL ); /* Undefined mode */ +#endif TESTCASE( fopen( "testfile", "w" ) != NULL ); system( "rm testfile" ); return TEST_RESULTS;