From e3c2d6c3fae088185ab83e19a65190e28120a3ee Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Thu, 2 Jun 2011 17:31:05 -0300 Subject: Test for bug 464 - "Can't create target lang package and namespace with the same name" --- tests/libsample/CMakeLists.txt | 1 + tests/libsample/sample.cpp | 33 +++++++++++++++++++++++++++++++++ tests/libsample/sample.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 tests/libsample/sample.cpp create mode 100644 tests/libsample/sample.h (limited to 'tests/libsample') diff --git a/tests/libsample/CMakeLists.txt b/tests/libsample/CMakeLists.txt index b2ac420ce..326b614cf 100644 --- a/tests/libsample/CMakeLists.txt +++ b/tests/libsample/CMakeLists.txt @@ -29,6 +29,7 @@ pointf.cpp polygon.cpp protected.cpp reference.cpp +sample.cpp samplenamespace.cpp simplefile.cpp size.cpp diff --git a/tests/libsample/sample.cpp b/tests/libsample/sample.cpp new file mode 100644 index 000000000..7e0a78f8a --- /dev/null +++ b/tests/libsample/sample.cpp @@ -0,0 +1,33 @@ +/* + * This file is part of the Shiboken Python Binding Generator project. + * + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * + * Contact: PySide team + * + * 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 + */ + +#include "sample.h" + +sample::sample::sample(int value) : m_value(value) +{ +} + +int sample::sample::value() const +{ + return m_value; +} + diff --git a/tests/libsample/sample.h b/tests/libsample/sample.h new file mode 100644 index 000000000..a789aeac1 --- /dev/null +++ b/tests/libsample/sample.h @@ -0,0 +1,42 @@ +/* + * This file is part of the Shiboken Python Binding Generator project. + * + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * + * Contact: PySide team + * + * 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 SAMPLE_H +#define SAMPLE_H + +#include "libsamplemacros.h" + +// namespace with the same name of the current package to try to mess up with the generator +namespace sample +{ + // to increase the mess we add a class with the same name of the package/namespace + class LIBSAMPLE_API sample + { + public: + sample(int value = 0); + int value() const; + private: + int m_value; + }; +} + +#endif -- cgit v1.2.3