ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Serialization/SearchResultReader.cs
(Generate patch)

Comparing trunk/RomCheater/Serialization/SearchResultReader.cs (file contents):
Revision 404 by william, Thu Jun 21 07:13:04 2012 UTC vs.
Revision 405 by william, Thu Jun 21 14:38:54 2012 UTC

--- trunk/RomCheater/Serialization/SearchResultReader.cs	2012/06/21 12:51:57	404
+++ trunk/RomCheater/Serialization/SearchResultReader.cs	2012/06/21 14:38:54	405
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using RomCheater.Docking.MemorySearch;
+using RomCheater.Logging;
 
 namespace RomCheater.Serialization
 {
@@ -25,6 +26,7 @@ namespace RomCheater.Serialization
         {
             try
             {
+                int ResultsRead = 0;
                 // SRD (string)
                 string magic = Encoding.UTF8.GetString(binReader.ReadBytes(3));
                 string SRD = "SRD";
@@ -45,6 +47,35 @@ namespace RomCheater.Serialization
                     throw new InvalidOperationException(string.Format("Result Count is zero"));
                 }
                 ResultCount = resultcount;
+                
+                //for (int i = 0; i < ResultCount; i++)
+                //{
+                //    try
+                //    {
+                //        ResultsRead = i;
+                //        uint address = 0;
+                //        // assume uint for data type
+                //        uint value = 0;
+                //        address = binReader.ReadUInt32();
+                //        value = binReader.ReadUInt32();
+                //        //if (i % 100000 == 0)
+                //        //    logger.VerboseDebug.WriteLine("Result: @0x{0:x8}=0x{1:x8}", address, value);
+                //    }
+                //    catch (Exception ex)
+                //    {
+                //        logger.VerboseError.WriteLine("SearchResultReader.ReadHeader():Consistency Check");
+                //        //logger.VerboseError.WriteLine(ex.ToString());
+                //        logger.VerboseError.WriteLine("Faied entry: {0}", ResultsRead);
+                //        break;
+                //    }
+                //    ResultsRead++; // add 1
+                //}
+                ////throw new NotImplementedException("DEBUG: testing SearchResultReader consistency");
+                //if (ResultCount != ResultsRead)
+                //{
+                //    throw new InvalidOperationException(string.Format("ResultCount does not match ResultsRead: 0x{0:x8} != 0x{1:x8}", ResultCount, ResultsRead));
+                //}  
+
             }
             catch (System.IO.EndOfStreamException) { }
         }