+void TextFileTestCase::ReadBig()
+{
+ static const size_t NUM_LINES = 10000;
+
+ {
+ wxFFile f(GetTestFileName(), "w");
+ for ( size_t n = 0; n < NUM_LINES; n++ )
+ {
+ fprintf(f.fp(), "Line %lu\n", (unsigned long)n + 1);
+ }
+ }
+
+ wxTextFile f;
+ CPPUNIT_ASSERT( f.Open(GetTestFileName()) );
+
+ CPPUNIT_ASSERT_EQUAL( NUM_LINES, f.GetLineCount() );
+ CPPUNIT_ASSERT_EQUAL( wxString("Line 1"), f[0] );
+ CPPUNIT_ASSERT_EQUAL( wxString("Line 999"), f[998] );
+ CPPUNIT_ASSERT_EQUAL( wxString("Line 1000"), f[999] );
+ CPPUNIT_ASSERT_EQUAL( wxString::Format("Line %lu", (unsigned long)NUM_LINES),
+ f[NUM_LINES - 1] );
+}
+