Browse Source

Test override secondary base Itanium.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
test-override-secondary-base-itanium
Dimitar Dobrev 5 years ago
parent
commit
a44308b3ad
  1. 18
      tests/CSharp/CSharp.Tests.cs
  2. 44
      tests/CSharp/CSharp.cpp
  3. 27
      tests/CSharp/CSharp.h

18
tests/CSharp/CSharp.Tests.cs

@ -102,6 +102,24 @@ public unsafe class CSharpTests : GeneratorTestFixture @@ -102,6 +102,24 @@ public unsafe class CSharpTests : GeneratorTestFixture
#pragma warning restore 0219
}
class MyClass : Der
{
public override int F => 10;
}
[Test]
public void TestDer()
{
using (var der = new MyClass())
{
using (var hasDer = new HasDer())
{
hasDer.SetDer(der);
Assert.That(hasDer.CallDer(), Is.EqualTo(10));
}
}
}
[Test]
public void TestReturnCharPointer()
{

44
tests/CSharp/CSharp.cpp

@ -865,6 +865,50 @@ AbstractWithProperty::~AbstractWithProperty() @@ -865,6 +865,50 @@ AbstractWithProperty::~AbstractWithProperty()
{
}
SB::SB()
{
}
SB::~SB()
{
}
int SB::f()
{
return 5;
}
Der::Der()
{
}
Der::~Der()
{
}
int Der::derf()
{
return 55;
}
HasDer::HasDer()
{
}
HasDer::~HasDer()
{
}
void HasDer::setDer(Der* value)
{
der = value;
}
int HasDer::callDer()
{
return der->f();
}
IgnoredType PropertyWithIgnoredType::ignoredType()
{
return _ignoredType;

27
tests/CSharp/CSharp.h

@ -537,6 +537,33 @@ class DLL_API IgnoredTypeInheritingNonIgnoredWithNoEmptyCtor : public P @@ -537,6 +537,33 @@ class DLL_API IgnoredTypeInheritingNonIgnoredWithNoEmptyCtor : public P
{
};
class DLL_API SB
{
public:
SB();
~SB();
virtual int f();
};
class DLL_API Der : public Foo, public SB
{
public:
Der();
~Der();
virtual int derf();
};
class DLL_API HasDer
{
public:
HasDer();
~HasDer();
void setDer(Der* value);
int callDer();
private:
Der* der = 0;
};
class DLL_API PropertyWithIgnoredType
{
public:

Loading…
Cancel
Save