Skip to content

Commit

Permalink
Remove logging of expected outcomes from MemoyMappedFile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nguerrera committed Jan 17, 2015
1 parent 40e5a99 commit e33e142
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ public bool RunTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass: iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ public bool RunTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass: iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("paSs. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("paSs. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down Expand Up @@ -405,7 +404,7 @@ private void RunTestLargeCapacity(Int64 capacity)
}
else
{
Console.WriteLine("Got expected {0}", aore.GetType().ToString());
// Got expected ArgumentOutOfRangeException
}
}
catch (IOException ioex)
Expand All @@ -421,7 +420,7 @@ private void RunTestLargeCapacity(Int64 capacity)
}
else
{
Console.WriteLine("Got expected {0}", ioex.GetType().ToString());
// Got expected IOException
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("paSs. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down Expand Up @@ -404,7 +403,7 @@ private void RunTestLargeCapacity(Int64 capacity)
}
else
{
Console.WriteLine("Got expected {0}", aore.GetType().ToString());
// Got expected ArgumentOutOfRangeException
}
}
catch (IOException ioex)
Expand All @@ -420,7 +419,7 @@ private void RunTestLargeCapacity(Int64 capacity)
}
else
{
Console.WriteLine("Got expected {0}", ioex.GetType().ToString());
// Got expected IOException
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand All @@ -85,9 +84,9 @@ public void VerifyFlushException<EXCTYPE>(String strLoc, MemoryMappedViewAccesso
_iCountErrors++;
Console.WriteLine("ERROR, {0}: No exception thrown, expected {1}", strLoc, typeof(EXCTYPE));
}
catch (EXCTYPE ex)
catch (EXCTYPE)
{
Console.WriteLine("{0}: Expected, {1}: {2}", strLoc, ex.GetType(), ex.Message);
// Expected
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public bool runTest()
// Default ViewAccessor size - whole MMF
using (MemoryMappedViewAccessor view = mmf.CreateViewAccessor())
{
Console.WriteLine("View Capacity: " + view.Capacity);

// position = 0, default (zeros)
VerifyRead<Boolean>("Loc001a", view, 0, false);
VerifyRead<Byte>("Loc001b", view, 0, 0);
Expand Down Expand Up @@ -210,8 +208,6 @@ public bool runTest()
// ViewAccessor starts at nonzero offset, spans remainder of MMF
using (MemoryMappedViewAccessor view = mmf.CreateViewAccessor(1000, 0))
{
Console.WriteLine(view.Capacity);

// position = 0
VerifyRead<Boolean>("Loc111a", view, 0, true);
VerifyRead<Byte>("Loc111b", view, 0, 1);
Expand Down Expand Up @@ -308,8 +304,6 @@ public bool runTest()
// ViewAccessor starts at nonzero offset, with size shorter than MMF
using (MemoryMappedViewAccessor view = mmf.CreateViewAccessor(2000, 10000))
{
Console.WriteLine(view.Capacity);

// position is last possible for type
VerifyRead<Boolean>("Loc214a", view, view.Capacity - 1, true);
VerifyRead<Byte>("Loc214b", view, view.Capacity - 1, Byte.MaxValue);
Expand Down Expand Up @@ -371,7 +365,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public bool runTest()
// Default ViewAccessor size - whole MMF
using (MemoryMappedViewAccessor view = mmf.CreateViewAccessor())
{
Console.WriteLine(view.Capacity);

// position = 0
VerifyWrite<Boolean>("Loc011a", view, 0, true);
VerifyWrite<Byte>("Loc011b", view, 0, 234);
Expand Down Expand Up @@ -155,8 +153,6 @@ public bool runTest()
// ViewAccessor starts at nonzero offset, spans remainder of MMF
using (MemoryMappedViewAccessor view2 = mmf.CreateViewAccessor(1000, 0))
{
Console.WriteLine(view2.Capacity);

// position = 0
VerifyWrite<Boolean>("Loc111a", view2, 0, true);
VerifyWrite<Byte>("Loc111b", view2, 0, 1);
Expand Down Expand Up @@ -203,8 +199,6 @@ public bool runTest()
// ViewAccessor starts at nonzero offset, with size shorter than MMF
using (MemoryMappedViewAccessor view = mmf.CreateViewAccessor(2000, 10000))
{
Console.WriteLine(view.Capacity);

// position is last possible for type
VerifyWrite<Boolean>("Loc214a", view, view.Capacity - 1, true);
VerifyWrite<Byte>("Loc214b", view, view.Capacity - 1, (byte)251);
Expand Down Expand Up @@ -263,7 +257,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand All @@ -85,9 +84,9 @@ public void VerifyFlushException<EXCTYPE>(String strLoc, MemoryMappedViewStream
_iCountErrors++;
Console.WriteLine("ERROR, {0}: No exception thrown, expected {1}", strLoc, typeof(EXCTYPE));
}
catch (EXCTYPE ex)
catch (EXCTYPE)
{
Console.WriteLine("{0}: Expected, {1}: {2}", strLoc, ex.GetType(), ex.Message);
// Expected
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public bool runTest()
// Default ViewStream size - whole MMF
using (MemoryMappedViewStream view = mmf.CreateViewStream())
{
Console.WriteLine("View Capacity: " + view.Capacity);

BinaryReader reader = new BinaryReader(view);
BinaryWriter writer = new BinaryWriter(view);

Expand Down Expand Up @@ -149,19 +147,17 @@ public bool runTest()
VerifyReadDouble("Loc074", reader2, BitConverter.ToDouble(byteArray1, 7));
reader2.BaseStream.Seek(0, SeekOrigin.Begin);
VerifyReadDecimal("Loc075", reader2, new Decimal(new Int32[] { BitConverter.ToInt32(byteArray1, 0), BitConverter.ToInt32(byteArray1, 4), BitConverter.ToInt32(byteArray1, 8), BitConverter.ToInt32(byteArray1, 12) }));
Console.WriteLine(reader2.BaseStream.Seek(2161, SeekOrigin.Begin));
reader2.BaseStream.Seek(2161, SeekOrigin.Begin);
VerifyReadDecimal("Loc076", reader2, dec);
VerifyReadBoolean("Loc077", reader2, true);
VerifyReadInt32("Loc078", reader2, 211209802);
Console.WriteLine(reader2.BaseStream.Seek(-1, SeekOrigin.End));
reader2.BaseStream.Seek(-1, SeekOrigin.End);
VerifyReadBoolean("Loc079", reader2, true);
}

// ViewStream starts at nonzero offset, spans remainder of MMF
using (MemoryMappedViewStream view = mmf.CreateViewStream(1000, 0))
{
Console.WriteLine(view.Capacity);

BinaryReader reader = new BinaryReader(view);
BinaryWriter writer = new BinaryWriter(view);

Expand Down Expand Up @@ -253,8 +249,6 @@ public bool runTest()
// ViewStream starts at nonzero offset, with size shorter than MMF
using (MemoryMappedViewStream view = mmf.CreateViewStream(2000, 10000))
{
Console.WriteLine(view.Capacity);

BinaryReader reader = new BinaryReader(view);
BinaryWriter writer = new BinaryWriter(view);

Expand Down Expand Up @@ -350,8 +344,6 @@ public bool runTest()
{
using (MemoryMappedViewStream view = mmf.CreateViewStream())
{
Console.WriteLine(view.Capacity);

BinaryReader reader = new BinaryReader(view);
BinaryWriter writer = new BinaryWriter(view);

Expand Down Expand Up @@ -434,8 +426,6 @@ public bool runTest()

using (MemoryMappedViewStream view = mmf.CreateViewStream(0, 10000, MemoryMappedFileAccess.CopyOnWrite))
{
Console.WriteLine(view.Capacity);

BinaryReader reader = new BinaryReader(view);
BinaryWriter writer = new BinaryWriter(view);

Expand Down Expand Up @@ -463,8 +453,6 @@ public bool runTest()

using (MemoryMappedViewStream view = mmf.CreateViewStream(0, 10000, MemoryMappedFileAccess.Read))
{
Console.WriteLine(view.Capacity);

BinaryReader reader = new BinaryReader(view);

// Read existing values
Expand Down Expand Up @@ -492,7 +480,6 @@ public bool runTest()

if (iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public bool runTest()
_iCountErrors++;
Console.WriteLine("ERROR, No exception thrown, expected NotSupportedException");
}
catch (NotSupportedException ex)
catch (NotSupportedException)
{
Console.WriteLine("Expected, {0}: {1}", ex.GetType(), ex.Message);
// Expected
}
catch (Exception ex)
{
Expand All @@ -77,7 +77,6 @@ public bool runTest()

if (_iCountErrors == 0)
{
Console.WriteLine("Pass. iCountTestcases==" + _iCountTestcases);
return true;
}
else
Expand Down

0 comments on commit e33e142

Please sign in to comment.