Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down