nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #02912
[Bug 1051847] [NEW] self contained item in array causes stack overflow
Public bug reported:
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
[TestFixture]
public class Reproduction {
class SelfContainer : IEnumerable { public IEnumerator GetEnumerator() { yield return this; } }
[Test]
public void SelfContainedItemFoundInArray() {
var item = new SelfContainer();
var items = new SelfContainer[] { new SelfContainer(), item };
// work around
Assert.True(((ICollection<SelfContainer>)items).Contains(item));
// causes StackOverflowException
Assert.Contains(item, items);
}
}
Reproduced in NUnit 2.6.1
See also bug #491300
** Affects: nunitv2
Importance: Undecided
Status: New
** Tags: framework
--
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/1051847
Title:
self contained item in array causes stack overflow
Status in NUnit V2 Test Framework:
New
Bug description:
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
[TestFixture]
public class Reproduction {
class SelfContainer : IEnumerable { public IEnumerator GetEnumerator() { yield return this; } }
[Test]
public void SelfContainedItemFoundInArray() {
var item = new SelfContainer();
var items = new SelfContainer[] { new SelfContainer(), item };
// work around
Assert.True(((ICollection<SelfContainer>)items).Contains(item));
// causes StackOverflowException
Assert.Contains(item, items);
}
}
Reproduced in NUnit 2.6.1
See also bug #491300
To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/1051847/+subscriptions
Follow ups
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Charlie Poole, 2013-10-05
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Charlie Poole, 2013-10-05
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Charlie Poole, 2012-11-03
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Charlie Poole, 2012-09-24
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-19
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-19
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Christian Marrocco, 2012-09-19
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-19
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Christian Marrocco, 2012-09-19
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-18
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Charlie Poole, 2012-09-18
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-17
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-17
-
[Bug 1051847] Re: self contained item in array causes stack overflow
From: Simone Busoli, 2012-09-17
-
[Bug 1051847] [NEW] self contained item in array causes stack overflow
From: Christian Marrocco, 2012-09-17
References