move TestTextInputStream() function in CppUnit's TextStreamTestCase class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-05-16 14:31:00 +00:00
parent 3f6e622f7c
commit 3dea816bd2
2 changed files with 21 additions and 45 deletions

View File

@@ -131,7 +131,6 @@
#define TEST_STACKWALKER
#define TEST_STDPATHS
#define TEST_STREAMS
#define TEST_TEXTSTREAM
#define TEST_TIMER
// #define TEST_VOLUME --FIXME! (RN)
#define TEST_WCHAR
@@ -3445,45 +3444,6 @@ static void TestTimeSpanFormat()
#endif // TEST_DATETIME
// ----------------------------------------------------------------------------
// wxTextInput/OutputStream
// ----------------------------------------------------------------------------
#ifdef TEST_TEXTSTREAM
#include "wx/txtstrm.h"
#include "wx/wfstream.h"
static void TestTextInputStream()
{
wxPuts(wxT("\n*** wxTextInputStream test ***"));
wxString filename = wxT("testdata.fc");
wxFileInputStream fsIn(filename);
if ( !fsIn.Ok() )
{
wxPuts(wxT("ERROR: couldn't open file."));
}
else
{
wxTextInputStream tis(fsIn);
size_t line = 1;
for ( ;; )
{
const wxString s = tis.ReadLine();
// line could be non empty if the last line of the file isn't
// terminated with EOL
if ( fsIn.Eof() && s.empty() )
break;
wxPrintf(wxT("Line %d: %s\n"), line++, s.c_str());
}
}
}
#endif // TEST_TEXTSTREAM
// ----------------------------------------------------------------------------
// entry point
@@ -3748,10 +3708,6 @@ int main(int argc, char **argv)
TestMemoryStream();
#endif // TEST_STREAMS
#ifdef TEST_TEXTSTREAM
TestTextInputStream();
#endif // TEST_TEXTSTREAM
#ifdef TEST_TIMER
TestStopWatch();
TestTimer();