Fix sign warnings in unit tests

svn-id: r34580
This commit is contained in:
Max Horn 2008-09-16 11:57:45 +00:00
parent 5a1c593bf2
commit 9d96d9d380
2 changed files with 15 additions and 15 deletions

View File

@ -33,37 +33,37 @@ class BufferedSeekableReadStreamTestSuite : public CxxTest::TestSuite {
Common::BufferedSeekableReadStream ssrs(&ms, 4);
byte b;
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)0 );
TS_ASSERT_EQUALS( ssrs.pos(), 0 );
ssrs.seek(1, SEEK_SET);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)1 );
TS_ASSERT_EQUALS( ssrs.pos(), 1 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 1 );
ssrs.seek(5, SEEK_CUR);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)7 );
TS_ASSERT_EQUALS( ssrs.pos(), 7 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 7 );
ssrs.seek(-3, SEEK_CUR);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)5 );
TS_ASSERT_EQUALS( ssrs.pos(), 5 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 5 );
ssrs.seek(0, SEEK_END);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)10 );
TS_ASSERT_EQUALS( ssrs.pos(), 10 );
TS_ASSERT( !ssrs.eos() );
b = ssrs.readByte();
TS_ASSERT( ssrs.eos() );
ssrs.seek(3, SEEK_END);
TS_ASSERT( !ssrs.eos() );
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)7 );
TS_ASSERT_EQUALS( ssrs.pos(), 7 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 7 );
ssrs.seek(8, SEEK_END);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)2 );
TS_ASSERT_EQUALS( ssrs.pos(), 2 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 2 );
}

View File

@ -17,7 +17,7 @@ class SeekableSubReadStreamTestSuite : public CxxTest::TestSuite {
for (i = start; i < end; ++i) {
TS_ASSERT( !ssrs.eos() );
TS_ASSERT_EQUALS( uint32(i - start), ssrs.pos() );
TS_ASSERT_EQUALS( i - start, ssrs.pos() );
ssrs.read(&b, 1);
TS_ASSERT_EQUALS( i, b );
@ -35,37 +35,37 @@ class SeekableSubReadStreamTestSuite : public CxxTest::TestSuite {
Common::SeekableSubReadStream ssrs(&ms, 1, 9);
byte b;
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)0 );
TS_ASSERT_EQUALS( ssrs.pos(), 0 );
ssrs.seek(1, SEEK_SET);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)1 );
TS_ASSERT_EQUALS( ssrs.pos(), 1 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 2 );
ssrs.seek(5, SEEK_CUR);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)7 );
TS_ASSERT_EQUALS( ssrs.pos(), 7 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 8 );
ssrs.seek(-3, SEEK_CUR);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)5 );
TS_ASSERT_EQUALS( ssrs.pos(), 5 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 6 );
ssrs.seek(0, SEEK_END);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)8 );
TS_ASSERT_EQUALS( ssrs.pos(), 8 );
TS_ASSERT( !ssrs.eos() );
b = ssrs.readByte();
TS_ASSERT( ssrs.eos() );
ssrs.seek(3, SEEK_END);
TS_ASSERT( !ssrs.eos() );
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)5 );
TS_ASSERT_EQUALS( ssrs.pos(), 5 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 6 );
ssrs.seek(8, SEEK_END);
TS_ASSERT_EQUALS( ssrs.pos(), (uint32)0 );
TS_ASSERT_EQUALS( ssrs.pos(), 0 );
b = ssrs.readByte();
TS_ASSERT_EQUALS( b, 1 );
}