X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2255c89f9a7662514e265d80cc6547d9d1b4b38..bca6a3a5553884d5e210706b144dc3855798934d:/tests/streams/fileback.cpp?ds=sidebyside diff --git a/tests/streams/fileback.cpp b/tests/streams/fileback.cpp index 0fbce3ec1e..484c95a8d5 100644 --- a/tests/streams/fileback.cpp +++ b/tests/streams/fileback.cpp @@ -19,15 +19,12 @@ #endif #include "wx/mstream.h" -#include "wx/fileback.h" +#include "wx/private/fileback.h" #include "bstream.h" -#if wxUSE_STREAMS - const size_t TESTSIZE = 256; const size_t BUFSIZE = 100; - /////////////////////////////////////////////////////////////////////////////// // Parent stream for testing @@ -67,7 +64,7 @@ public: private: void Read(wxInputStream& in, size_t size1, size_t size2, size_t size3); - void Len(wxInputStream& in); + void Len(wxBackedInputStream& in); void Seek(wxInputStream& in); char m_testdata[TESTSIZE]; @@ -91,7 +88,7 @@ void backStream::ReadLenSeek() void backStream::LenSeekRead() { - wxBackingFile bf(new wxMemoryInputStream(m_testdata, TESTSIZE), BUFSIZE); + wxBackingFile bf(new TestStream(m_testdata, TESTSIZE), BUFSIZE); wxBackedInputStream in(bf); Len(in); @@ -174,9 +171,9 @@ void backStream::Read(wxInputStream& in, CPPUNIT_ASSERT(in.Eof()); } -void backStream::Len(wxInputStream& in) +void backStream::Len(wxBackedInputStream& in) { - CPPUNIT_ASSERT_EQUAL(wxFileOffset(TESTSIZE), in.GetLength()); + CPPUNIT_ASSERT_EQUAL(wxFileOffset(TESTSIZE), in.FindLength()); } void backStream::Seek(wxInputStream& in) @@ -189,7 +186,7 @@ void backStream::Seek(wxInputStream& in) for (wxFileOffset i = TESTSIZE - 1; i >= 0; i--) { CPPUNIT_ASSERT_EQUAL(i, in.SeekI(i)); CPPUNIT_ASSERT_EQUAL(i, in.TellI()); - CPPUNIT_ASSERT_EQUAL(char(i), in.GetC()); + CPPUNIT_ASSERT_EQUAL(int(i), in.GetC()); CPPUNIT_ASSERT_EQUAL(size_t(1), in.LastRead()); CPPUNIT_ASSERT(in.IsOk()); } @@ -198,5 +195,3 @@ void backStream::Seek(wxInputStream& in) // Register the stream sub suite, by using some stream helper macro. // Note: Don't forget to connect it to the base suite (See: bstream.cpp => StreamCase::suite()) STREAM_TEST_SUBSUITE_NAMED_REGISTRATION(backStream) - -#endif // wxUSE_STREAMS