aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/handle.h
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-15 13:36:08 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:07:21 -0300
commitb4d648d09c293816a6f15ffdc2bdc7b0ec0792fb (patch)
treee0abf184f9669801845a75872c0dd2441e5f238e /tests/libsample/handle.h
parentc8892e123c0f4512e7ecd78b85d499b02b31e1e4 (diff)
Created unit test for unknown class holder.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/libsample/handle.h')
-rw-r--r--tests/libsample/handle.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/libsample/handle.h b/tests/libsample/handle.h
new file mode 100644
index 000000000..f76277f5a
--- /dev/null
+++ b/tests/libsample/handle.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the Shiboken Python Binding Generator project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team <contact@pyside.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef HANDLE_H
+#define HANDLE_H
+
+#include "libsamplemacros.h"
+
+class OBJ
+{
+};
+
+typedef OBJ* HANDLE;
+
+class HandleHolder
+{
+public:
+ explicit HandleHolder(HANDLE ptr = 0) : m_handle(ptr) {}
+ void set(HANDLE ptr) { m_handle = m_handle; }
+ HANDLE get() { return m_handle; }
+
+ static HANDLE createHandle()
+ {
+ return (HANDLE) new OBJ;
+ }
+
+ bool compare(HandleHolder* other)
+ {
+ return other->m_handle == m_handle;
+ }
+private:
+ HANDLE m_handle;
+};
+
+#endif // HANDLE_H
+