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 67fc7c5508
commit da45f88c53

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()