mirror of https://github.com/mono/CppSharp.git
7 changed files with 8 additions and 64 deletions
@ -1,52 +0,0 @@
@@ -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<EmptyTestInterface,CppMockObject> (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<EmptyTestInterface,CppMockObject> (CppMockObject.Instance); |
||||
cppip.Dispose (); |
||||
// should throw
|
||||
Assert.Fail (); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
|
||||
#include "AbiTests.h" |
||||
#include "ByValTests.h" |
||||
|
||||
ClassWithCopyCtor::ClassWithCopyCtor(const ClassWithCopyCtor& f) { |
||||
x = f.x; |
@ -1,3 +1 @@
@@ -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'. |
||||
|
Loading…
Reference in new issue