NUnitEqualityComparer.StreamsE­qual fails for same stream

Bug #400502 reported by Charlie Poole
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Status tracked in Trunk
Trunk
Fix Released
Medium
Charlie Poole

Bug Description

Bug Reported and fixed in NUnit 2.5 series:

When asserting a stream of non-zero length is equal to itself, NUnit
returns a failure because the comparer assumes it is two separate
references that it can read in parallel.

The following test incorrectly fails with:
NUnit.Framework.AssertionException: Stream lengths are both 3. Streams
differ at offset 0.

[Test]
public void TestStreamsEqual()
{
Stream exampleStream = new MemoryStream(new byte[] {1, 2, 3});
Assert.That(exampleStream, Is.EqualTo(exampleStream));
}

Changed in nunit-3.0:
assignee: nobody → Charlie Poole (charlie.poole)
importance: Undecided → Medium
milestone: none → 2.9.1
status: New → Confirmed
Changed in nunit-3.0:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.