2 #if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS) 15 # if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) 23 # if (!defined(STLPORT) && (defined (__GNUC__) && (__GNUC__ > 3))) || \ 24 (defined (STLPORT) && !defined (_STLP_NO_CUSTOM_IO) && !defined (_STLP_NO_MEMBER_TEMPLATES) && \ 25 !((defined (_STLP_MSVC) && (_STLP_MSVC < 1300)) || \ 26 (defined (__GNUC__) && (__GNUC__ < 3)) || \ 27 (defined (__SUNPRO_CC)) || \ 28 (defined (__DMC__) && defined (_DLL)))) 29 # define DO_CUSTOM_FACET_TEST 51 # if defined (STLPORT) && (defined (_STLP_NO_WCHAR_T) || !defined (_STLP_USE_EXCEPTIONS)) 55 # if !defined (STLPORT) || !defined (_STLP_WIN32) 58 # if defined (CHECK_BIG_FILE) 61 # if !defined (DO_CUSTOM_FACET_TEST) 78 void streambuf_output();
79 void win32_file_format();
82 # if !defined (STLPORT) || !defined (_STLP_WIN32) 86 # if defined (CHECK_BIG_FILE) 100 f << 1 <<
'\n' << 2.0 <<
'\n' <<
"abcd\n" <<
"ghk lm\n" <<
"abcd ef";
132 #if defined (STLPORT) && !defined (_STLP_USE_WIN32_IO) 146 char buf[16] = { 0,
'1',
'2',
'3' };
161 f << 1 <<
'\n' << 2.0 <<
'\n' <<
"abcd\n" <<
"ghk lm\n" <<
"abcd ef";
164 f.seekg( 0, ios_base::beg );
200 f.seekg( 0, ios_base::beg );
217 for (
int i = 0;
i < 50; ++
i) {
232 for (
int i = 0;
i < 50; ++
i) {
249 for (
int i = 0;
i < 50; ++
i) {
254 is.seekg(
p, ios_base::beg );
265 for (
int i = 0;
i < 50; ++
i) {
310 long expected_pos = 0;
318 long expected_pos = 9;
326 long expected_pos = 0;
328 long expected_pos = 9;
348 ss <<
"1234567\n89\n";
349 ss.seekg( 0, ios_base::beg );
383 char b1[] = {
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x' };
387 int chars_read = (
int)
s.rdbuf()->sgetn(
b1,
sizeof(
b1) );
393 char b2[10] = {
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y' };
409 char b1[] = {
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x',
'x' };
413 int chars_read = (
int)
s.rdbuf()->sgetn(
b1,
sizeof(
b1) );
424 char b2[10] = {
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y',
'y' };
434 #if !defined (STLPORT) || \ 435 (!defined (_STLP_NO_WCHAR_T) && defined (_STLP_USE_EXCEPTIONS)) 456 s <<
L"1234567890\n";
460 wchar_t b1[] = {
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x',
L'x' };
466 int chars_read = (
int)
s.rdbuf()->sgetn(
b1,
sizeof(
b1) /
sizeof(
wchar_t) );
476 off =
s.rdbuf()->pubseekoff(0, ios_base::beg);
479 wchar_t b2[10] = {
L'y',
L'y',
L'y',
L'y',
L'y',
L'y',
L'y',
L'y',
L'y',
L'y' };
495 ss <<
"1234567\n89\n";
496 ss.seekg( 0, ios_base::beg );
499 ss.get( *os.rdbuf(),
'\n' );
515 ofstr <<
"01234567890123456789";
543 # if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS) 575 const char*
file_name =
"win32_file_format.tmp";
576 const size_t nb_lines = 2049;
581 for (
size_t i = 0;
i < nb_lines - 1; ++
i) {
590 string line, last_line;
591 size_t nb_read_lines = 0;
602 #if defined (DO_CUSTOM_FACET_TEST) 608 typedef my_state state_type;
612 #if !defined (STLPORT) 620 typedef char intern_type;
621 typedef char extern_type;
622 typedef my_state state_type;
624 explicit codecvt(
size_t __refs = 0) :
locale::facet(__refs) {}
626 const intern_type* __from,
628 const intern_type*& __from_next,
631 extern_type*& __to_next)
const 632 { __from_next = __from; __to_next = __to;
return noconv; }
635 const extern_type* __from,
637 const extern_type*& __from_next,
640 intern_type*& __to_next)
const 641 { __from_next = __from; __to_next = __to;
return noconv; }
643 result unshift(state_type&,
646 extern_type*& __to_next)
const 647 { __to_next = __to;
return noconv; }
652 bool always_noconv()
const throw()
655 int length(
const state_type&,
656 const extern_type* __from,
657 const extern_type* __end,
659 {
return (
int)
min(static_cast<size_t>(__end - __from),
__max); }
661 int max_length()
const throw()
670 # if defined (__BORLANDC__) && (__BORLANDC__ < 0x590) 679 #if defined (DO_CUSTOM_FACET_TEST) 680 const char* fileName =
"test_file.txt";
684 ofstr <<
"0123456789";
692 my_ifstream ifstr(fileName);
695 # if !defined (STLPORT) || defined (_STLP_USE_EXCEPTIONS) 705 # if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T) 722 # if defined (CHECK_BIG_FILE) 723 void FstreamTest::big_file()
725 vector<pair<streamsize, streamoff> > file_pos;
741 for (
int i = 0;
i < 20; ++
i) {
748 nb *= CHECK_BIG_FILE;
753 if (
index % 1024 == 0) {
756 if (file_pos.size() > 1) {
757 CPPUNIT_ASSERT( file_pos[file_pos.size() - 1].first > file_pos[file_pos.size() - 2].first );
769 vector<pair<streamsize, streamsize> >::const_iterator pit(file_pos.begin()),
770 pitEnd(file_pos.end());
771 for (; pit != pitEnd; ++pit) {
772 in.seekg((*pit).first);
775 size_t lastStarPos =
line.rfind(
'*');
800 # if (defined (STLPORT) && defined (_STLP_USE_WIN32_IO)) || \ 801 (!defined (STLPORT) && (defined (WIN32) || defined (_WIN32))) 802 const char* nullStreamName =
"NUL";
804 const char* nullStreamName =
"/dev/null";
807 ofstream nullStream(nullStreamName);
812 ofstream nullStream(nullStreamName, ios_base::ate);
822 ofstream nullStream(nullStreamName, ios_base::app);
827 ifstream nullStream(nullStreamName);
832 ifstream nullStream(nullStreamName, ios_base::ate);
837 fstream nullStream(nullStreamName);
878 for (
int i = 0;
i < 0x200; ++
i ) {
892 f.seekg( 0, ios_base::beg );
904 # if !defined (STLPORT) || !defined (_STLP_WIN32) 907 # if (defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE)) && !defined(_STLP_USE_DEFAULT_FILE_OFFSET)
static UCHAR ULONG UCHAR ULONG UCHAR * output
basic_ostream< char, char_traits< char > > ostream
basic_ostringstream< char, char_traits< char >, allocator< char > > ostringstream
_STLP_PRIV _Ios_Setf_Manip _STLP_CALL setiosflags(ios_base::fmtflags __flag)
#define CPPUNIT_TEST_SUITE(X)
_STLP_PRIV _Setfill_Manip< _CharT > _STLP_CALL setfill(_CharT __c)
pair< _T1, _T2 > _STLP_CALL make_pair(_T1 __x, _T2 __y)
GLenum GLuint GLenum GLsizei const GLchar * buf
_Traits::pos_type pos_type
static const locale &_STLP_CALL classic()
GLenum GLuint GLenum GLsizei length
static CRYPT_DATA_BLOB b1[]
double __cdecl trunc(double)
basic_ifstream< char, char_traits< char > > ifstream
#define CPPUNIT_TEST_SUITE_END()
CPPUNIT_TEST_SUITE_REGISTRATION(FstreamTest)
std::string const & str() const
bool has_facet(const locale &__loc) _STLP_NOTHROW
basic_ofstream< char, char_traits< char > > ofstream
char_traits< char > ::pos_type pos_type
const GLuint GLenum const GLvoid * binary
int seek(void *fd, ulong off, int mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define CPPUNIT_ASSERT(X)
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_STLP_PRIV _Ios_Manip_1< streamsize > _STLP_CALL setw(int __n)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
static CRYPT_DATA_BLOB b2[]
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *