From 3ad3fd8923b57172df6e0ec64f34c0daf5fb136d Mon Sep 17 00:00:00 2001 From: Alex Corrado Date: Fri, 27 May 2011 22:43:57 -0400 Subject: [PATCH] A little more test reorganization. They all pass now.. HOORAY! --- tests/{AbiTests.cs => ByValTests.cs} | 0 tests/CppInstancePtrTests.cs | 52 ------------------- tests/Makefile.am | 7 ++- tests/Native/{AbiTests.cpp => ByValTests.cpp} | 2 +- tests/Native/{AbiTests.h => ByValTests.h} | 0 tests/README | 4 +- tests/Tests.csproj | 7 ++- 7 files changed, 8 insertions(+), 64 deletions(-) rename tests/{AbiTests.cs => ByValTests.cs} (100%) delete mode 100644 tests/CppInstancePtrTests.cs rename tests/Native/{AbiTests.cpp => ByValTests.cpp} (95%) rename tests/Native/{AbiTests.h => ByValTests.h} (100%) diff --git a/tests/AbiTests.cs b/tests/ByValTests.cs similarity index 100% rename from tests/AbiTests.cs rename to tests/ByValTests.cs diff --git a/tests/CppInstancePtrTests.cs b/tests/CppInstancePtrTests.cs deleted file mode 100644 index b5a8388..0000000 --- a/tests/CppInstancePtrTests.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// CppInstancePtrTests.cs: Test cases to exercise the CppInstancePtr -// -// Author: -// Alexander Corrado (alexander.corrado@gmail.com) -// -// Copyright (C) 2010 Alexander Corrado -// - -using System; -using System.Runtime.InteropServices; -using NUnit.Framework; - -using Mono.VisualC.Interop; -using Tests.Support; - -namespace Tests { - [TestFixture] - public class CppInstancePtrTests { - - static CppInstancePtr uninitialized; - - [Test] - [ExpectedException (typeof (ObjectDisposedException))] - public void TestUninitialized () - { - Assert.IsFalse (uninitialized.IsManagedAlloc, "#A1"); - Assert.AreEqual (IntPtr.Zero, uninitialized.Native, "#A2"); - } - - [Test] - public void TestForManagedObject () - { - CppInstancePtr cppip = CppInstancePtr.ForManagedObject (CppMockObject.Instance); - Assert.AreNotEqual (IntPtr.Zero, cppip.Native, "#A1"); - Assert.IsTrue (cppip.IsManagedAlloc, "#A2"); - cppip.Dispose (); - } - - [Test] - [ExpectedException (typeof (ObjectDisposedException))] - public void TestDisposed () - { - CppInstancePtr cppip = CppInstancePtr.ForManagedObject (CppMockObject.Instance); - cppip.Dispose (); - // should throw - Assert.Fail (); - } - - } -} - diff --git a/tests/Makefile.am b/tests/Makefile.am index b8d6118..dc92e0b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,15 +7,14 @@ INTEROP_DLL = \ TEST_DLL = $(BUILD_DIR)/Test.dll HDR = \ - Native/AbiTests.h + Native/ByValTests.h NATIVE = \ Native/NUnit.cpp \ - Native/AbiTests.cpp + Native/ByValTests.cpp MANAGED = \ - AbiTests.cs \ - CppInstancePtrTests.cs \ + ByValTests.cs \ Support/CppMockObject.cs \ Support/CppNUnitAsserts.cs diff --git a/tests/Native/AbiTests.cpp b/tests/Native/ByValTests.cpp similarity index 95% rename from tests/Native/AbiTests.cpp rename to tests/Native/ByValTests.cpp index fd0ace3..ff5fa8a 100644 --- a/tests/Native/AbiTests.cpp +++ b/tests/Native/ByValTests.cpp @@ -1,5 +1,5 @@ -#include "AbiTests.h" +#include "ByValTests.h" ClassWithCopyCtor::ClassWithCopyCtor(const ClassWithCopyCtor& f) { x = f.x; diff --git a/tests/Native/AbiTests.h b/tests/Native/ByValTests.h similarity index 100% rename from tests/Native/AbiTests.h rename to tests/Native/ByValTests.h diff --git a/tests/README b/tests/README index 3f03489..dd10005 100644 --- a/tests/README +++ b/tests/README @@ -1,3 +1 @@ -This directory contains tests for the cpp binding. It should probably be merged with -src/Tests. To run them, type 'make run'. - +This directory contains tests for the cpp binding. To run them, type 'make run'. diff --git a/tests/Tests.csproj b/tests/Tests.csproj index 8c17fef..4e6def5 100644 --- a/tests/Tests.csproj +++ b/tests/Tests.csproj @@ -52,8 +52,7 @@ - - + @@ -70,8 +69,8 @@ - - + +