X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/216a72f3b9ab2bf72f489aceac0093138a6e7707..32753ae949d861ddaf7c66f4c483bc57493c6c6c:/tests/streams/datastreamtest.cpp diff --git a/tests/streams/datastreamtest.cpp b/tests/streams/datastreamtest.cpp index efe700336c..d42dc381c9 100644 --- a/tests/streams/datastreamtest.cpp +++ b/tests/streams/datastreamtest.cpp @@ -65,7 +65,7 @@ private: // register in the unnamed registry so that these tests are run by default CPPUNIT_TEST_SUITE_REGISTRATION( DataStreamTestCase ); -// also include in it's own registry so that these tests can be run alone +// also include in its own registry so that these tests can be run alone CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( DataStreamTestCase, "DataStreamTestCase" ); DataStreamTestCase::DataStreamTestCase() @@ -75,7 +75,7 @@ DataStreamTestCase::DataStreamTestCase() static wxFloat64 TestFloatRW(wxFloat64 fValue) { - wxFileOutputStream* pFileOutput = new wxFileOutputStream( _T("mytext.dat") ); + wxFileOutputStream* pFileOutput = new wxFileOutputStream( wxT("mytext.dat") ); wxDataOutputStream* pDataOutput = new wxDataOutputStream( *pFileOutput ); *pDataOutput << fValue; @@ -83,7 +83,7 @@ wxFloat64 TestFloatRW(wxFloat64 fValue) delete pDataOutput; delete pFileOutput; - wxFileInputStream* pFileInput = new wxFileInputStream( _T("mytext.dat") ); + wxFileInputStream* pFileInput = new wxFileInputStream( wxT("mytext.dat") ); wxDataInputStream* pDataInput = new wxDataInputStream( *pFileInput ); wxFloat64 fInFloat; @@ -115,14 +115,14 @@ private: ValueArray InValues(Size); { - wxFileOutputStream FileOutput( _T("mytext.dat") ); + wxFileOutputStream FileOutput( wxT("mytext.dat") ); wxDataOutputStream DataOutput( FileOutput ); (DataOutput.*pfnWriter)(Values, Size); } { - wxFileInputStream FileInput( _T("mytext.dat") ); + wxFileInputStream FileInput( wxT("mytext.dat") ); wxDataInputStream DataInput( FileInput ); (DataInput.*pfnReader)(&*InValues.begin(), InValues.size()); @@ -153,7 +153,8 @@ public: ProcessData(&*Values.begin(), Values.size(), pfnWriter, pfnReader); } - bool Ok(void) const { + bool IsOk() const + { return m_ok; } }; @@ -165,14 +166,14 @@ T TestRW(const T &Value) T InValue; { - wxFileOutputStream FileOutput( _T("mytext.dat") ); + wxFileOutputStream FileOutput( wxT("mytext.dat") ); wxDataOutputStream DataOutput( FileOutput ); DataOutput << Value; } { - wxFileInputStream FileInput( _T("mytext.dat") ); + wxFileInputStream FileInput( wxT("mytext.dat") ); wxDataInputStream DataInput( FileInput ); DataInput >> InValue; @@ -214,8 +215,8 @@ void DataStreamTestCase::LongLongRW() CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l)) == wxLongLong(0x12345678l) ); CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l, 0xabcdef01l)) == wxLongLong(0x12345678l, 0xabcdef01l) ); - CPPUNIT_ASSERT( TestMultiRW(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() ); - CPPUNIT_ASSERT( TestMultiRW(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() ); } #endif @@ -238,8 +239,8 @@ void DataStreamTestCase::Int64RW() CPPUNIT_ASSERT( TestRW(wxUint64(0x12345678l)) == wxUint64(0x12345678l) ); CPPUNIT_ASSERT( TestRW((wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l)) == (wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l) ); - CPPUNIT_ASSERT( TestMultiRW(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() ); - CPPUNIT_ASSERT( TestMultiRW(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() ); } #endif