X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Ffilemode.c;h=4c68e8beed93fc67ebdaf8efc251674b6e5cb5f4;hb=d865c4403fc91d1f1ac95ba76febcee9f429bb97;hp=0e293aba2cfc55a6a4f1487b569b20efb8cd70c7;hpb=393020b6e48719d27699dea6b29e53025bbd5123;p=pdclib diff --git a/functions/_PDCLIB/filemode.c b/functions/_PDCLIB/filemode.c index 0e293ab..4c68e8b 100644 --- a/functions/_PDCLIB/filemode.c +++ b/functions/_PDCLIB/filemode.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /* _PDCLIB_filemode( const char * ) This file is part of the Public Domain C Library (PDCLib). @@ -8,6 +6,8 @@ #include +#ifndef REGTEST + /* Helper function that parses the C-style mode string passed to fopen() into the PDCLib flags FREAD, FWRITE, FAPPEND, FRW (read-write) and FBIN (binary mode). @@ -54,11 +54,15 @@ unsigned int _PDCLIB_filemode( char const * const mode ) return 0; } +#endif + #ifdef TEST -#include <_PDCLIB_test.h> + +#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 | _PDCLIB_FWRITE ) ); @@ -78,8 +82,8 @@ int main( void ) TESTCASE( _PDCLIB_filemode( "r++" ) == 0 ); TESTCASE( _PDCLIB_filemode( "wbb" ) == 0 ); TESTCASE( _PDCLIB_filemode( "a+bx" ) == 0 ); +#endif return TEST_RESULTS; } #endif -