[Scummvm-cvs-logs] SF.net SVN: scummvm:[40726] scummvm/trunk/test/common

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue May 19 14:39:53 CEST 2009


Revision: 40726
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40726&view=rev
Author:   lordhoto
Date:     2009-05-19 12:39:53 +0000 (Tue, 19 May 2009)

Log Message:
-----------
- Formatting
- Warning fixes
- Rename "test_read_v2_as_v1" to "test_read_v1_as_v2", to match behavior

Modified Paths:
--------------
    scummvm/trunk/test/common/bufferedseekablereadstream.h
    scummvm/trunk/test/common/seekablesubreadstream.h
    scummvm/trunk/test/common/serializer.h

Modified: scummvm/trunk/test/common/bufferedseekablereadstream.h
===================================================================
--- scummvm/trunk/test/common/bufferedseekablereadstream.h	2009-05-19 11:42:14 UTC (rev 40725)
+++ scummvm/trunk/test/common/bufferedseekablereadstream.h	2009-05-19 12:39:53 UTC (rev 40726)
@@ -22,7 +22,7 @@
 
 		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());
 	}
 

Modified: scummvm/trunk/test/common/seekablesubreadstream.h
===================================================================
--- scummvm/trunk/test/common/seekablesubreadstream.h	2009-05-19 11:42:14 UTC (rev 40725)
+++ scummvm/trunk/test/common/seekablesubreadstream.h	2009-05-19 12:39:53 UTC (rev 40726)
@@ -24,7 +24,7 @@
 		}
 
 		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());
 	}
 

Modified: scummvm/trunk/test/common/serializer.h
===================================================================
--- scummvm/trunk/test/common/serializer.h	2009-05-19 11:42:14 UTC (rev 40725)
+++ scummvm/trunk/test/common/serializer.h	2009-05-19 12:39:53 UTC (rev 40726)
@@ -34,13 +34,13 @@
 		_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 @@
 		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 @@
 		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 @@
 	// 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);
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list