X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Ffilemode.c;h=fd734fcf632325ce025bcbec8aaba0a988b6e905;hb=9507e63e4b8558c8a3337521853f80f72f83a689;hp=460cc6e4cfb5ec0dc2bdf53ae194ada37e303236;hpb=29faf8750ba4a051038ae5ff09a54920f0c74e81;p=pdclib.old diff --git a/functions/_PDCLIB/filemode.c b/functions/_PDCLIB/filemode.c index 460cc6e..fd734fc 100644 --- a/functions/_PDCLIB/filemode.c +++ b/functions/_PDCLIB/filemode.c @@ -6,8 +6,6 @@ Permission is granted to use, modify, and / or redistribute at will. */ -#ifndef REGTEST - #include /* Helper function that parses the C-style mode string passed to fopen() into @@ -56,14 +54,11 @@ unsigned int _PDCLIB_filemode( char const * const mode ) return 0; } -#endif - #ifdef TEST #include <_PDCLIB_test.h> int main( void ) { -#ifndef REGTEST TESTCASE( _PDCLIB_filemode( "r" ) == _PDCLIB_FREAD ); TESTCASE( _PDCLIB_filemode( "w" ) == _PDCLIB_FWRITE ); TESTCASE( _PDCLIB_filemode( "a" ) == _PDCLIB_FAPPEND ); @@ -79,10 +74,12 @@ int main( void ) TESTCASE( _PDCLIB_filemode( "rb+" ) == ( _PDCLIB_FREAD | _PDCLIB_FRW | _PDCLIB_FBIN ) ); TESTCASE( _PDCLIB_filemode( "wb+" ) == ( _PDCLIB_FWRITE | _PDCLIB_FRW | _PDCLIB_FBIN ) ); TESTCASE( _PDCLIB_filemode( "ab+" ) == ( _PDCLIB_FAPPEND | _PDCLIB_FRW | _PDCLIB_FBIN ) ); -#else - puts( " NOTEST fopen() test driver is PDCLib-specific." ); -#endif + TESTCASE( _PDCLIB_filemode( "x" ) == 0 ); + TESTCASE( _PDCLIB_filemode( "r++" ) == 0 ); + TESTCASE( _PDCLIB_filemode( "wbb" ) == 0 ); + TESTCASE( _PDCLIB_filemode( "a+bx" ) == 0 ); return TEST_RESULTS; } #endif +