From 27a2016f8a5ae281a53548a28a7f53427f952993 Mon Sep 17 00:00:00 2001 From: Tom Spilman Date: Mon, 11 Aug 2014 19:34:11 -0500 Subject: [PATCH] Added reference test case. --- tests/Basic/Basic.Tests.cs | 3 +++ tests/Basic/Basic.cpp | 8 ++++++++ tests/Basic/Basic.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/Basic/Basic.Tests.cs b/tests/Basic/Basic.Tests.cs index cb9eac03..78b0ac27 100644 --- a/tests/Basic/Basic.Tests.cs +++ b/tests/Basic/Basic.Tests.cs @@ -70,6 +70,9 @@ public class BasicTests : GeneratorTestFixture str = "Hello"; hello.StringInOut(ref str); Assert.That(str, Is.EqualTo("StringInOut")); + str = "Hello"; + hello.StringInOutRef(ref str); + Assert.That(str, Is.EqualTo("StringInOutRef")); } [Test] diff --git a/tests/Basic/Basic.cpp b/tests/Basic/Basic.cpp index e405f60d..9d8c6d11 100644 --- a/tests/Basic/Basic.cpp +++ b/tests/Basic/Basic.cpp @@ -222,6 +222,14 @@ void Hello::StringInOut(CS_IN_OUT const char** str) *str = "Failed"; } +void Hello::StringInOutRef(CS_IN_OUT const char*& str) +{ + if (strcmp(str, "Hello") == 0) + str = "StringInOutRef"; + else + str = "Failed"; +} + int unsafeFunction(const Bar& ret, char* testForString, void (*foo)(int)) { return ret.A; diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 9f7318eb..cd3e992b 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -136,7 +136,7 @@ public: void StringOut(CS_OUT const char** str); void StringOutRef(CS_OUT const char*& str); void StringInOut(CS_IN_OUT const char** str); - //void StringInOutRef(CS_OUT const char*& str); + void StringInOutRef(CS_IN_OUT const char*& str); }; class DLL_API AbstractFoo