Browse Source

Fixed the new tests for properties to work around the existing unrelated bug of incorrect field values.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/94/head
Dimitar Dobrev 12 years ago
parent
commit
961316f96d
  1. 3
      tests/CSharpTemp/CSharpTemp.Tests.cs
  2. 7
      tests/CSharpTemp/CSharpTemp.cpp
  3. 6
      tests/CSharpTemp/CSharpTemp.h

3
tests/CSharpTemp/CSharpTemp.Tests.cs

@ -76,8 +76,7 @@ public class CSharpTempTests @@ -76,8 +76,7 @@ public class CSharpTempTests
Assert.That(p.prop, Is.EqualTo(150));
ComplexType complexType = new ComplexType();
complexType.check = 5;
p.complexType = complexType;
Assert.That(p.complexType.check, Is.EqualTo(5));
Assert.That(p.complexType.check(), Is.EqualTo(5));
}
}

7
tests/CSharpTemp/CSharpTemp.cpp

@ -96,12 +96,17 @@ long P::prop() @@ -96,12 +96,17 @@ long P::prop()
return m_property + 100;
}
int ComplexType::check()
{
return 5;
}
ComplexType P::complexType()
{
return m_complexType;
}
void P::setComplexType(ComplexType value)
void P::setComplexType(const ComplexType& value)
{
m_complexType = value;
}

6
tests/CSharpTemp/CSharpTemp.h

@ -86,10 +86,10 @@ public: @@ -86,10 +86,10 @@ public:
virtual long prop();
};
class ComplexType
class DLL_API ComplexType
{
public:
int check;
int check();
};
class DLL_API P : Proprietor
@ -99,7 +99,7 @@ public: @@ -99,7 +99,7 @@ public:
virtual long prop();
ComplexType complexType();
void setComplexType(ComplexType value);
void setComplexType(const ComplexType& value);
private:
ComplexType m_complexType;

Loading…
Cancel
Save