nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #00027
[Bug 400502] Re: NUnitEqualityComparer.StreamsEqual fails for same stream
** Changed in: nunit-3.0
Status: Confirmed => Fix Committed
** Also affects: nunit-3.0/trunk
Importance: Medium
Assignee: Charlie Poole (charlie.poole)
Status: Fix Committed
--
NUnitEqualityComparer.StreamsEqual fails for same stream
https://bugs.launchpad.net/bugs/400502
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
Status in NUnit Test Framework: Fix Committed
Status in NUnit Framework trunk series: Fix Committed
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));
}
References