ugly VC6 compilation fix (non-ugly doesn't want to work for some reason as VC6 flat out refuses to use our overloaded operator<<)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -19,16 +19,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __VISUALC6__
|
||||
// there is no support for int64 output in VC6 stream classes so output it as
|
||||
// long which should work as long as we don't use >2GB files in this test...
|
||||
static std::ostream& operator<<(std::ostream& ostr, const wxFileOffset& fo)
|
||||
{
|
||||
ostr << (long)fo;
|
||||
return ostr;
|
||||
}
|
||||
#endif // __VISUALC6__
|
||||
|
||||
#include "wx/mstream.h"
|
||||
#include "wx/private/fileback.h"
|
||||
#include "bstream.h"
|
||||
@@ -184,21 +174,21 @@ void backStream::Read(wxInputStream& in,
|
||||
|
||||
void backStream::Len(wxBackedInputStream& in)
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(wxFileOffset(TESTSIZE), in.FindLength());
|
||||
CPPUNIT_ASSERT_EQUAL(TESTSIZE, size_t(in.FindLength()));
|
||||
}
|
||||
|
||||
void backStream::Seek(wxInputStream& in)
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(wxFileOffset(TESTSIZE), in.SeekI(TESTSIZE));
|
||||
CPPUNIT_ASSERT_EQUAL(TESTSIZE, size_t(in.SeekI(TESTSIZE)));
|
||||
in.GetC();
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(0), in.LastRead());
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(0), size_t(in.LastRead()));
|
||||
CPPUNIT_ASSERT(in.Eof());
|
||||
|
||||
for (wxFileOffset i = TESTSIZE - 1; i >= 0; i--) {
|
||||
CPPUNIT_ASSERT_EQUAL(i, in.SeekI(i));
|
||||
CPPUNIT_ASSERT_EQUAL(i, in.TellI());
|
||||
CPPUNIT_ASSERT_EQUAL(int(i), in.GetC());
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(1), in.LastRead());
|
||||
for (size_t i = TESTSIZE; i > 0; i--) {
|
||||
CPPUNIT_ASSERT_EQUAL(i - 1, size_t(in.SeekI(i)));
|
||||
CPPUNIT_ASSERT_EQUAL(i - 1, size_t(in.TellI()));
|
||||
CPPUNIT_ASSERT_EQUAL(int(i - 1), in.GetC());
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(1), size_t(in.LastRead()));
|
||||
CPPUNIT_ASSERT(in.IsOk());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user