-/* $Id$ */
-
/* fwrite( const void *, size_t, size_t, FILE * )
This file is part of the Public Domain C Library (PDCLib).
*/
#include <stdio.h>
-#include <_PDCLIB_glue.h>
#ifndef REGTEST
+#include <_PDCLIB_glue.h>
+
#include <stdbool.h>
#include <string.h>
return 0;
}
_PDCLIB_size_t offset = 0;
- bool lineend = false;
+ /* TODO: lineend */
+ /* bool lineend = false; */
size_t nmemb_i;
for ( nmemb_i = 0; nmemb_i < nmemb; ++nmemb_i )
{
{
/* Remember last newline, in case we have to do a partial line-buffered flush */
offset = stream->bufidx;
- lineend = true;
+ /* lineend = true; */
}
if ( stream->bufidx == stream->bufsize )
{
/* Returning number of objects completely buffered */
return nmemb_i;
}
- lineend = false;
+ /* lineend = false; */
}
}
}
int main( void )
{
- FILE * fh;
- TESTCASE( ( fh = tmpfile() ) != NULL );
- TESTCASE( fwrite( "SUCCESS testing fwrite()\n", 1, 25, fh ) == 25 );
- /* TODO: Add readback test. */
- TESTCASE( fclose( fh ) == 0 );
+ /* Testing covered by fread(). */
return TEST_RESULTS;
}