From 73efb97d11b9fbb38abbb1251d60166464757d98 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Nov 2008 22:50:15 +0000 Subject: [PATCH] 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 --- tests/streams/fileback.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/streams/fileback.cpp b/tests/streams/fileback.cpp index 07e11c7900..8733b67ba7 100644 --- a/tests/streams/fileback.cpp +++ b/tests/streams/fileback.cpp @@ -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()); } }