Check stream error in LastRead() unit test too

It doesn't make sense to call LastRead() if an error happened while
reading, so check if it did.
This commit is contained in:
Vadim Zeitlin
2021-02-02 01:59:39 +01:00
parent 414f211b8a
commit 3978a0df0e

View File

@@ -170,9 +170,11 @@ protected:
char buf[5];
(void)stream_in.Read(buf, 5);
CPPUNIT_ASSERT_EQUAL(5, stream_in.LastRead());
REQUIRE( stream_in.GetLastError() == wxSTREAM_NO_ERROR );
CHECK( stream_in.LastRead() == 5 );
(void)stream_in.GetC();
CPPUNIT_ASSERT_EQUAL(1, stream_in.LastRead());
REQUIRE( stream_in.GetLastError() == wxSTREAM_NO_ERROR );
CHECK( stream_in.LastRead() == 1 );
}
void Input_CanRead()