From 3978a0df0ec2da81832ea9ae458455a3a205c78c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Feb 2021 01:59:39 +0100 Subject: [PATCH] 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. --- tests/streams/bstream.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/streams/bstream.h b/tests/streams/bstream.h index bdabe07eb0..10e3f6f38d 100644 --- a/tests/streams/bstream.h +++ b/tests/streams/bstream.h @@ -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()