Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Gendarme: Failing test for CheckNewThreadWithoutStartRule for case when thread reference is stored in local array. #14

Open
wants to merge 2 commits into from

1 participant

@older

No description provided.

Oleg Deribas added some commits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 7, 2011
  1. Add failing test for CheckNewThreadWithoutStartRule for case when thread

    Oleg Deribas authored
    reference is stored in local array.
Commits on Apr 27, 2012
  1. Merge remote-tracking branch 'upstream/master'

    Oleg Deribas authored
This page is out of date. Refresh to see the latest.
View
15 gendarme/rules/Gendarme.Rules.BadPractice/Test/CheckNewThreadWithoutStartTest.cs
@@ -125,6 +125,21 @@ public void TestLocalVariable ()
Assert.AreEqual (0, runner.Defects.Count, "Count");
}
+ public void LocalArray()
+ {
+ var threads = new Thread[1];
+ threads[0] = new Thread(ThreadStart);
+ threads[0].Start();
+ }
+
+ [Test]
+ public void TestLocalArray()
+ {
+ MethodDefinition method = GetTest("LocalArray");
+ Assert.AreEqual(RuleResult.Success, runner.CheckMethod(method), "RuleResult");
+ Assert.AreEqual(0, runner.Defects.Count, "Count");
+ }
+
public object Return ()
{
Thread a = new Thread (ThreadStart);
Something went wrong with that request. Please try again.