diff --git a/tests/CLI/CLI.cpp b/tests/CLI/CLI.cpp index e006f2b8..e312f770 100644 --- a/tests/CLI/CLI.cpp +++ b/tests/CLI/CLI.cpp @@ -5,6 +5,8 @@ int Types::AttributedSum(int A, int B) return A + B; } +TestProtectedDestructors::~TestProtectedDestructors() {} + std::string Date::testStdString(std::string s) { return s + "_test"; diff --git a/tests/CLI/CLI.h b/tests/CLI/CLI.h index fa64384a..20a7d8e5 100644 --- a/tests/CLI/CLI.h +++ b/tests/CLI/CLI.h @@ -32,8 +32,6 @@ class DLL_API TestProtectedDestructors ~TestProtectedDestructors(); }; -TestProtectedDestructors::~TestProtectedDestructors() {} - // Tests the insertion operator (<<) to ToString method pass class DLL_API Date { diff --git a/tests/Common/Common.cpp b/tests/Common/Common.cpp index 5a1891d5..5db7a7a2 100644 --- a/tests/Common/Common.cpp +++ b/tests/Common/Common.cpp @@ -358,6 +358,10 @@ Bar indirectReturn() return Bar(); } +TestDelegates::TestDelegates() : A(Double), B(Double), C(&TestDelegates::Triple) +{ +} + int TestDelegates::Double(int N) { return N * 2; @@ -449,6 +453,10 @@ int operator *(TestMoveOperatorToClass klass, int b) return klass.A * b; } +TestMoveOperatorToClass::TestMoveOperatorToClass() +{ +} + TestMoveOperatorToClass operator-(const TestMoveOperatorToClass& b) { TestMoveOperatorToClass nb; @@ -835,6 +843,32 @@ void HasOverridenSetter::setVirtualGetter(int value) { } +TestIndexedProperties::TestIndexedProperties() : p(1), f() +{ +} + +foo_t& TestIndexedProperties::operator[](int i) { return p; } +const TestProperties& TestIndexedProperties::operator[](short b) { return f; } +foo_t TestIndexedProperties::operator[](const char* name) { return p; } +foo_t* TestIndexedProperties::operator[](float f) { return &p; } +TestProperties* TestIndexedProperties::operator[](unsigned char b) { return &f; } +Bar& TestIndexedProperties::operator[](unsigned long i) +{ + return bar; +} +Bar& TestIndexedProperties::operator[](const TypeMappedIndex& key) +{ + return bar; +} + +const foo_t& TestIndexedProperties::operator[](double f) { return p; } +foo_t TestIndexedProperties::operator[](TestProperties b) { return p; } + +int TestIndexedProperties::operator[](CS_OUT char key) +{ + return key; +} + TypeMappedIndex::TypeMappedIndex() { } @@ -855,6 +889,12 @@ TestWideStrings::TestWideStrings() { } +LPCWSTR TestWideStrings::GetWidePointer() { return L"Hello"; } + +LPCWSTR TestWideStrings::GetWideNullPointer() { return 0; } + +TestFixedArrays::TestFixedArrays() {} + InternalCtorAmbiguity::InternalCtorAmbiguity(void* param) { // cause a crash to indicate this is the incorrect ctor to invoke @@ -1166,11 +1206,27 @@ void sMallFollowedByCapital() { } +TestNotStaticClass::TestNotStaticClass() +{ +} + +TestNotStaticClass TestNotStaticClass::StaticFunction() +{ + return TestNotStaticClass(); +} + +int TestStaticClass::Add(int a, int b) { return a + b; } +int TestStaticClass::GetOneTwoThree() { return 123; } +int TestStaticClass::_Mult(int a, int b) { return a * b; } +int TestStaticClass::GetFourFiveSix() { return 456; } + TestStaticClass& TestStaticClass::operator=(const TestStaticClass& oth) { return *this; } +int TestStaticClassDerived::Foo() { return 0; } + HasCopyAndMoveConstructor::HasCopyAndMoveConstructor(int value) { field = value; @@ -1358,6 +1414,9 @@ TestGetterSetterToProperties::TestGetterSetterToProperties() { } +int TestGetterSetterToProperties::getWidth() { return 640; } +int TestGetterSetterToProperties::getHeight() { return 480; } + PointerToTypedefPointerTest::PointerToTypedefPointerTest() { } @@ -1371,3 +1430,34 @@ void DLL_API PointerToPrimitiveTypedefPointerTestMethod(LPINT lp, int valToSet) { *lp = valToSet; } + +TestArraysPointers::TestArraysPointers(MyEnum* values, int count) +{ + if (values && count) Value = values[0]; +} + +TestCopyConstructorRef::TestCopyConstructorRef() +{ +} + +TestCopyConstructorRef::TestCopyConstructorRef(const TestCopyConstructorRef& other) +{ + A = other.A; + B = other.B; +} + + +SomeStruct::SomeStruct() : p(1) {} + +ClassWithOverloadedOperators::ClassWithOverloadedOperators() { + +} + +ClassWithOverloadedOperators::ClassWithOverloadedOperators::operator char() { return 1; } +ClassWithOverloadedOperators::operator int() { return 2; } +ClassWithOverloadedOperators::operator short() { return 3; } +bool ClassWithOverloadedOperators::operator<(const ClassWithOverloadedOperators& other) const { + return true; +} + +int TestIndexedPropertiesInValueType::operator[](int i) { return i; } diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 963b4461..f0e27c2f 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -344,8 +344,6 @@ struct DLL_API TestMoveOperatorToClass int B; }; -TestMoveOperatorToClass::TestMoveOperatorToClass() {} - DLL_API int operator *(TestMoveOperatorToClass klass, int b); DLL_API TestMoveOperatorToClass operator-(const TestMoveOperatorToClass& b); @@ -392,10 +390,6 @@ struct DLL_API TestDelegates MemberDelegate C; }; -TestDelegates::TestDelegates() : A(Double), B(Double), C(&TestDelegates::Triple) -{ -} - namespace DelegateNamespace { namespace Nested @@ -437,14 +431,6 @@ private: TestStaticClass(); }; -int TestStaticClass::Add(int a, int b) { return a + b; } - -int TestStaticClass::GetOneTwoThree() { return 123; } - -int TestStaticClass::_Mult(int a, int b) { return a * b; } - -int TestStaticClass::GetFourFiveSix() { return 456; } - struct DLL_API TestStaticClassDerived : TestStaticClass { static int Foo(); @@ -453,8 +439,6 @@ private: TestStaticClassDerived(); }; -int TestStaticClassDerived::Foo() { return 0; } - class DLL_API TestNotStaticClass { public: @@ -463,15 +447,6 @@ private: TestNotStaticClass(); }; -TestNotStaticClass::TestNotStaticClass() -{ -} - -TestNotStaticClass TestNotStaticClass::StaticFunction() -{ - return TestNotStaticClass(); -} - class HasIgnoredField { Base fieldOfIgnoredType; @@ -498,16 +473,6 @@ public: float B; }; -TestCopyConstructorRef::TestCopyConstructorRef() -{ -} - -TestCopyConstructorRef::TestCopyConstructorRef(const TestCopyConstructorRef& other) -{ - A = other.A; - B = other.B; -} - template struct EmptyNamedNestedEnum { @@ -521,8 +486,6 @@ typedef struct DLL_API SomeStruct foo_t p; } SomeStruct; -SomeStruct::SomeStruct() : p(1) {} - class DLL_API SomeClassExtendingTheStruct : public SomeStruct { }; @@ -550,15 +513,6 @@ public: virtual bool operator<(const ClassWithOverloadedOperators &other) const; }; -ClassWithOverloadedOperators::ClassWithOverloadedOperators() {} -ClassWithOverloadedOperators::operator char() { return 1; } -ClassWithOverloadedOperators::operator int() { return 2; } -ClassWithOverloadedOperators::operator short() { return 3; } -bool ClassWithOverloadedOperators:: - operator<(const ClassWithOverloadedOperators &other) const { - return true; -} - // Tests global static function generation DLL_API int Function(); @@ -696,36 +650,12 @@ private: Bar bar; }; -TestIndexedProperties::TestIndexedProperties() : p(1), f() {} -foo_t& TestIndexedProperties::operator[](int i) { return p; } -foo_t TestIndexedProperties::operator[](const char* name) { return p; } -foo_t* TestIndexedProperties::operator[](float f) { return &p; } -const foo_t& TestIndexedProperties::operator[](double f) { return p; } -TestProperties* TestIndexedProperties::operator[](unsigned char b) { return &f; } -const TestProperties& TestIndexedProperties::operator[](short b) { return f; } -foo_t TestIndexedProperties::operator[](TestProperties b) { return p; } -Bar& TestIndexedProperties::operator[](unsigned long i) -{ - return bar; -} -Bar& TestIndexedProperties::operator[](const TypeMappedIndex& key) -{ - return bar; -} -int TestIndexedProperties::operator[](CS_OUT char key) -{ - return key; -} - - struct DLL_API TestIndexedPropertiesInValueType { public: int operator[](int i); }; -int TestIndexedPropertiesInValueType::operator[](int i) { return i; } - // Tests variables struct DLL_API TestVariables { @@ -742,9 +672,6 @@ struct DLL_API TestWideStrings LPCWSTR GetWideNullPointer(); }; -LPCWSTR TestWideStrings::GetWidePointer() { return L"Hello"; } -LPCWSTR TestWideStrings::GetWideNullPointer() { return 0; } - enum struct MyEnum { A, B, C }; typedef void (*VoidPtrRetFunctionTypedef) (); @@ -761,8 +688,6 @@ public: int ZeroSizedArray[0]; }; -TestFixedArrays::TestFixedArrays() {} - class DLL_API TestArraysPointers { public: @@ -771,11 +696,6 @@ public: MyEnum Value; }; -TestArraysPointers::TestArraysPointers(MyEnum *values, int count) -{ - if (values && count) Value = values[0]; -} - class DLL_API NonPrimitiveType { public: @@ -799,9 +719,6 @@ struct DLL_API TestGetterSetterToProperties int getHeight(); }; -int TestGetterSetterToProperties::getWidth() { return 640; } -int TestGetterSetterToProperties::getHeight() { return 480; } - // Tests conversion operators of classes class DLL_API ClassA {