Browse Source

Moved some tests definitions from the header to the source file.

pull/232/head
triton 12 years ago
parent
commit
a33277f233
  1. 17
      tests/Basic/Basic.cpp
  2. 14
      tests/Basic/Basic.h

17
tests/Basic/Basic.cpp

@ -14,6 +14,8 @@ const char* Foo::GetANSI()
return "ANSI"; return "ANSI";
} }
Foo2::Foo2() {}
Foo2 Foo2::operator<<(signed int i) Foo2 Foo2::operator<<(signed int i)
{ {
Foo2 foo; Foo2 foo;
@ -197,6 +199,8 @@ int ImplementsAbstractFoo::pureFunction2()
return 15; return 15;
} }
ReturnsAbstractFoo::ReturnsAbstractFoo() {}
const AbstractFoo& ReturnsAbstractFoo::getFoo() const AbstractFoo& ReturnsAbstractFoo::getFoo()
{ {
return i; return i;
@ -228,6 +232,11 @@ Bar::Item operator |(Bar::Item left, Bar::Item right)
return left | right; return left | right;
} }
TestDelegates::TestDelegates() : A(Double), B(Double),
C(&TestDelegates::Triple)
{}
TestCopyConstructorRef::TestCopyConstructorRef() TestCopyConstructorRef::TestCopyConstructorRef()
{ {
} }
@ -237,3 +246,11 @@ TestCopyConstructorRef::TestCopyConstructorRef(const TestCopyConstructorRef& oth
A = other.A; A = other.A;
B = other.B; B = other.B;
} }
TestArraysPointers::TestArraysPointers(MyEnum *values, int count)
{
if (values && count) Value = values[0];
}
int TestGetterSetterToProperties::getWidth() { return 640; }
int TestGetterSetterToProperties::getHeight() { return 480; }

14
tests/Basic/Basic.h

@ -43,6 +43,8 @@ class DLL_API Foo2 : public Foo
public: public:
Foo2();
int C; int C;
Foo2 operator<<(signed int i); Foo2 operator<<(signed int i);
@ -142,6 +144,7 @@ public:
class DLL_API ReturnsAbstractFoo class DLL_API ReturnsAbstractFoo
{ {
public: public:
ReturnsAbstractFoo();
const AbstractFoo& getFoo(); const AbstractFoo& getFoo();
private: private:
@ -243,7 +246,7 @@ struct DLL_API TestDelegates
typedef int (*DelegateInClass)(int); typedef int (*DelegateInClass)(int);
typedef int(TestDelegates::*MemberDelegate)(int); typedef int(TestDelegates::*MemberDelegate)(int);
TestDelegates() : A(Double), B(Double) { C = &TestDelegates::Triple; } TestDelegates();
static int Double(int N) { return N * 2; } static int Double(int N) { return N * 2; }
int Triple(int N) { return N * 3; } int Triple(int N) { return N * 3; }
@ -367,16 +370,13 @@ enum struct MyEnum { A, B, C };
class DLL_API TestArraysPointers class DLL_API TestArraysPointers
{ {
public: public:
TestArraysPointers(MyEnum *values, int count) TestArraysPointers(MyEnum *values, int count);
{
if (values && count) Value = values[0];
}
MyEnum Value; MyEnum Value;
}; };
struct DLL_API TestGetterSetterToProperties struct DLL_API TestGetterSetterToProperties
{ {
int getWidth() { return 640; } int getWidth();
int getHeight() { return 480; } int getHeight();
}; };

Loading…
Cancel
Save