aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-08-31 21:50:40 -0300
committerHugo Lima <hugo.lima@openbossa.org>2009-09-01 13:51:24 -0300
commit684cb83c834b04eed7b8a84842b7f75e7a45f9ee (patch)
tree7f8be458db131eec976bb8676b55836990023875
parent7b4bb821d11cb43eb7ad748cd4f4344841f516bb (diff)
Added an example of a class with a private destructor.
-rw-r--r--tests/libsample/privatedtor.h18
-rw-r--r--tests/samplebinding/CMakeLists.txt1
-rw-r--r--tests/samplebinding/global.h1
-rw-r--r--tests/samplebinding/typesystem_sample.xml1
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/libsample/privatedtor.h b/tests/libsample/privatedtor.h
new file mode 100644
index 000000000..16c4f6320
--- /dev/null
+++ b/tests/libsample/privatedtor.h
@@ -0,0 +1,18 @@
+
+#ifndef PRIVATEDTOR_H
+#define PRIVATEDTOR_H
+
+class PrivateDtor
+{
+ PrivateDtor* instance()
+ {
+ static PrivateDtor self;
+ return &self;
+ }
+private:
+ PrivateDtor() {}
+ PrivateDtor(const PrivateDtor&) {}
+ ~PrivateDtor() {}
+};
+
+#endif
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index cc509d772..0486ec925 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -15,6 +15,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/mapuser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/nondefaultctor_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/pairuser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/point_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/sample/privatedtor_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/reference_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/sample_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/samplenamespace_wrapper.cpp
diff --git a/tests/samplebinding/global.h b/tests/samplebinding/global.h
index 893917654..90e9b863f 100644
--- a/tests/samplebinding/global.h
+++ b/tests/samplebinding/global.h
@@ -14,3 +14,4 @@
#include "reference.h"
#include "virtualmethods.h"
#include "nondefaultctor.h"
+#include "privatedtor.h"
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 168befbee..e8bce2fe1 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -209,6 +209,7 @@
<value-type name="PairUser"/>
<value-type name="ListUser"/>
<value-type name="NonDefaultCtor" />
+ <object-type name="PrivateDtor" />
<rejection class="ListUser" function-name="createList()"/>
<rejection class="ListUser" function-name="callCreateList()"/>