/[RomCheater]/trunk/RomCheater/Serialization/SearchResultReader.cs
ViewVC logotype

Diff of /trunk/RomCheater/Serialization/SearchResultReader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Serialization/SearchResultReader.cs	2012/06/21 07:13:04	403
+++ trunk/RomCheater/Serialization/SearchResultReader.cs	2012/06/21 14:38:54	405
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using RomCheater.Docking.MemorySearch;
+using RomCheater.Logging;
 
 namespace RomCheater.Serialization
 {
@@ -25,6 +26,7 @@
         {
             try
             {
+                int ResultsRead = 0;
                 // SRD (string)
                 string magic = Encoding.UTF8.GetString(binReader.ReadBytes(3));
                 string SRD = "SRD";
@@ -45,6 +47,35 @@
                     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) { }
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22