aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample
diff options
context:
space:
mode:
authorMatti Airas <matti.p.airas@nokia.com>2010-03-17 17:09:15 -0300
committerMatti Airas <matti.p.airas@nokia.com>2010-03-17 17:09:15 -0300
commit21bcdc289ba9ece35780369a5e86a68498a6ddae (patch)
treead2a151f4f810eb8a6e8fc96acb994b3e202cae4 /tests/libsample
parentf9b62c6a5b3f7232bb00a5ab39fd8037fc9c7d81 (diff)
added support for pure virtual methods returning void ptrs
the return statements now have correct values for pure virtual methods returning void pointers. also added a dummy test for this (can't really test it properly until the semantics of casting the python return value into a void pointer is properly defined -- if ever).
Diffstat (limited to 'tests/libsample')
-rw-r--r--tests/libsample/abstract.h1
-rw-r--r--tests/libsample/derived.cpp7
-rw-r--r--tests/libsample/derived.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/libsample/abstract.h b/tests/libsample/abstract.h
index 008570560..cdfbb30fb 100644
--- a/tests/libsample/abstract.h
+++ b/tests/libsample/abstract.h
@@ -70,6 +70,7 @@ public:
static int getObjectId(Abstract* obj) { return obj->id(); }
virtual void pureVirtual() = 0;
+ virtual void* pureVirtualReturningVoidPtr() = 0;
virtual void unpureVirtual();
virtual PrintFormat returnAnEnum() = 0;
diff --git a/tests/libsample/derived.cpp b/tests/libsample/derived.cpp
index 1a19fe137..1e8303692 100644
--- a/tests/libsample/derived.cpp
+++ b/tests/libsample/derived.cpp
@@ -57,6 +57,12 @@ Derived::pureVirtual()
{
}
+void*
+Derived::pureVirtualReturningVoidPtr()
+{
+ return 0;
+}
+
void
Derived::unpureVirtual()
{
@@ -100,6 +106,7 @@ Derived::otherOverloaded(int a, double b)
struct SecretClass : public Abstract {
virtual void pureVirtual() {}
+ virtual void* pureVirtualReturningVoidPtr() { return 0; }
virtual PrintFormat returnAnEnum() { return Short; }
};
diff --git a/tests/libsample/derived.h b/tests/libsample/derived.h
index c5acb9488..e6d3f0fb3 100644
--- a/tests/libsample/derived.h
+++ b/tests/libsample/derived.h
@@ -61,6 +61,7 @@ public:
Derived(int id = -1);
virtual ~Derived();
virtual void pureVirtual();
+ virtual void* pureVirtualReturningVoidPtr();
virtual void unpureVirtual();
virtual PrintFormat returnAnEnum() { return Short; }