From f6679213b27dfcc6ea3d8ba2ec1e2b1c9c4d971b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 16 May 2014 21:41:52 +0300 Subject: [PATCH] fix CSharpTemp.TestDestructors TestDestructors test cannot be run twice as a static variable holds data from the first run. Add an init function to set the static variable to a known state. Signed-off-by: Tomi Valkeinen --- tests/CSharpTemp/CSharpTemp.Tests.cs | 1 + tests/CSharpTemp/CSharpTemp.h | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/CSharpTemp/CSharpTemp.Tests.cs b/tests/CSharpTemp/CSharpTemp.Tests.cs index 5d30205f..64691b18 100644 --- a/tests/CSharpTemp/CSharpTemp.Tests.cs +++ b/tests/CSharpTemp/CSharpTemp.Tests.cs @@ -89,6 +89,7 @@ public class CSharpTempTests : GeneratorTestFixture [Test] public void TestDestructors() { + CSharpTemp.TestDestructors.InitMarker(); Assert.AreEqual(0, CSharpTemp.TestDestructors.Marker); var dtors = new TestDestructors(); diff --git a/tests/CSharpTemp/CSharpTemp.h b/tests/CSharpTemp/CSharpTemp.h index a8d073e0..2a0106a7 100644 --- a/tests/CSharpTemp/CSharpTemp.h +++ b/tests/CSharpTemp/CSharpTemp.h @@ -138,6 +138,7 @@ private: // Tests destructors struct DLL_API TestDestructors { + static void InitMarker() { Marker = 0; } static int Marker; TestDestructors();