9 #ifndef _MAPPEDIOSTREAM_TEST_H_
10 #define _MAPPEDIOSTREAM_TEST_H_
16 #include <cxxtest/TestSuite.h>
32 stream.
write(
" Worldly", 6 );
35 const struct stat statBuf( stream.getStat() );
36 TS_ASSERT_EQUALS( statBuf.st_size, 16 );
44 stream.
read( buffer, 16 );
45 TS_ASSERT_EQUALS( stream.
bytesRead(), 16U );
46 TS_ASSERT_SAME_DATA( buffer,
"Hello World", 12 );
51 stream.
read( buf, 3 );
52 TS_ASSERT_EQUALS( stream.
bytesRead(), 3U );
53 TS_ASSERT_SAME_DATA( buf,
"o W", 4 );
55 remove(
"MappedIOStream_Test.log" );
60 #endif // _MAPPEDIOSTREAM_TEST_H
bool seek(unsigned int location)
Definition: MappedIOStream.cpp:66
size_t bytesRead()
Indicates the number of bytes read in the last operation.
Definition: InStream.h:162
Replacement for standard template class string.
Definition: Str.h:12
Contains the MappedIOStream class declaration.
virtual IOStream & read(char *buffer, size_t num)
reads num bytes from buffer to the output buffer/stream
Definition: MappedIOStream.cpp:38
size_t bytesWritten()
Definition: OutStream.h:203
void test2Read(void)
Definition: MappedIOStream_Test.h:39
void test1Write(void)
Definition: MappedIOStream_Test.h:27
IOStream & write(const char *buffer, size_t num)
writes num bytes from buffer to the output buffer/stream
Definition: MappedIOStream.cpp:92
Wraps Memory mapped file with an IOStream class.
Definition: MappedIOStream.h:27
Unit tests for MappedIOStream class.
Definition: MappedIOStream_Test.h:23