From 67f1b6fae7f17e3f4b7672e9145d467fe151562f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 19 May 2009 12:39:53 +0000 Subject: - Formatting - Warning fixes - Rename "test_read_v2_as_v1" to "test_read_v1_as_v2", to match behavior svn-id: r40726 --- test/common/bufferedseekablereadstream.h | 2 +- test/common/seekablesubreadstream.h | 2 +- test/common/serializer.h | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/common/bufferedseekablereadstream.h b/test/common/bufferedseekablereadstream.h index 1b9caddbb8..74401ad202 100644 --- a/test/common/bufferedseekablereadstream.h +++ b/test/common/bufferedseekablereadstream.h @@ -22,7 +22,7 @@ class BufferedSeekableReadStreamTestSuite : public CxxTest::TestSuite { TS_ASSERT(!ssrs.eos()); - TS_ASSERT_EQUALS(0, ssrs.read(&b, 1)); + TS_ASSERT_EQUALS((uint)0, ssrs.read(&b, 1)); TS_ASSERT(ssrs.eos()); } diff --git a/test/common/seekablesubreadstream.h b/test/common/seekablesubreadstream.h index 126edcd978..b6e584e510 100644 --- a/test/common/seekablesubreadstream.h +++ b/test/common/seekablesubreadstream.h @@ -24,7 +24,7 @@ class SeekableSubReadStreamTestSuite : public CxxTest::TestSuite { } TS_ASSERT(!ssrs.eos()); - TS_ASSERT_EQUALS(0, ssrs.read(&b, 1)); + TS_ASSERT_EQUALS((uint)0, ssrs.read(&b, 1)); TS_ASSERT(ssrs.eos()); } diff --git a/test/common/serializer.h b/test/common/serializer.h index 7f79d88de0..d9d1ce1577 100644 --- a/test/common/serializer.h +++ b/test/common/serializer.h @@ -34,13 +34,13 @@ public: _inStreamV2 = new Common::MemoryReadStream(contents_v2, sizeof(contents_v2)); } - void tearDown() { - delete _inStreamV1; - delete _inStreamV2; - } + void tearDown() { + delete _inStreamV1; + delete _inStreamV2; + } // A method which reads a v1 file - void readVersioned_v1(Common::SeekableReadStream *stream, int version) { + void readVersioned_v1(Common::SeekableReadStream *stream, Common::Serializer::Version version) { Common::Serializer ser(stream, 0); TS_ASSERT(ser.syncMagic("MAGI", 4)); @@ -51,17 +51,17 @@ public: uint32 tmp; ser.syncAsUint16BE(tmp, Common::Serializer::Version(1)); - TS_ASSERT_EQUALS(tmp, 0x0607); + TS_ASSERT_EQUALS(tmp, (uint16)0x0607); ser.syncAsSint16LE(tmp, Common::Serializer::Version(1)); - TS_ASSERT_EQUALS(tmp, -2); + TS_ASSERT_EQUALS((int16)tmp, -2); ser.syncAsByte(tmp); - TS_ASSERT_EQUALS(tmp, 0x0a); + TS_ASSERT_EQUALS(tmp, (uint8)0x0a); } // A method which reads a v2 file - void readVersioned_v2(Common::SeekableReadStream *stream, int version) { + void readVersioned_v2(Common::SeekableReadStream *stream, Common::Serializer::Version version) { Common::Serializer ser(stream, 0); TS_ASSERT(ser.syncMagic("MAGI", 4)); @@ -78,19 +78,19 @@ public: tmp = 0x12345678; ser.syncAsUint32LE(tmp, Common::Serializer::Version(2)); if (ser.getVersion() < 2) { - TS_ASSERT_EQUALS(tmp, 0x12345678); + TS_ASSERT_EQUALS(tmp, (uint32)0x12345678); } else { - TS_ASSERT_EQUALS(tmp, 0x05040302); + TS_ASSERT_EQUALS(tmp, (uint32)0x05040302); } ser.syncAsUint16BE(tmp, Common::Serializer::Version(1)); - TS_ASSERT_EQUALS(tmp, 0x0607); + TS_ASSERT_EQUALS(tmp, (uint32)0x0607); // Skip over obsolete data ser.skip(2, Common::Serializer::Version(1), Common::Serializer::Version(1)); ser.syncAsByte(tmp); - TS_ASSERT_EQUALS(tmp, 0x0a); + TS_ASSERT_EQUALS(tmp, (uint8)0x0a); } void test_read_v1_as_v1() { @@ -101,7 +101,7 @@ public: // read v2 data correctly. It should instead error out if it // detects a version newer than its current version. - void test_read_v2_as_v1() { + void test_read_v1_as_v2() { readVersioned_v2(_inStreamV1, 1); } -- cgit v1.2.3