diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 00:03:30 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 00:03:30 -0500 |
| commit | e20faa8fd950a97d511adbec40c13eeb1093563d (patch) | |
| tree | f839f76e304b44f2229372912b186711d8a41399 | |
| parent | 64f5df38e8bde270bd6749bcc93ce596f69e4dc3 (diff) | |
| download | sigen-e20faa8fd950a97d511adbec40c13eeb1093563d.tar.gz sigen-e20faa8fd950a97d511adbec40c13eeb1093563d.tar.xz sigen-e20faa8fd950a97d511adbec40c13eeb1093563d.zip | |
Started Ability test class and also adding base class for sigmod classes
| -rw-r--r-- | sigmod/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | sigmod/test/CMakeLists.txt | 21 | ||||
| -rw-r--r-- | sigmod/test/Global.h | 37 | ||||
| -rw-r--r-- | sigmod/test/TestAbility.cpp | 84 | ||||
| -rw-r--r-- | sigmod/test/TestAbility.h | 56 | ||||
| -rw-r--r-- | sigmod/test/TestSigmodObject.cpp | 53 | ||||
| -rw-r--r-- | sigmod/test/TestSigmodObject.h | 55 |
7 files changed, 308 insertions, 0 deletions
diff --git a/sigmod/CMakeLists.txt b/sigmod/CMakeLists.txt index 891d5ec4..00386010 100644 --- a/sigmod/CMakeLists.txt +++ b/sigmod/CMakeLists.txt @@ -103,6 +103,8 @@ TARGET_LINK_LIBRARIES(sigmod LINK_INTERFACE_LIBRARIES sigcore ) +ADD_SUBDIRECTORY(test) + INSTALL( TARGETS sigmod diff --git a/sigmod/test/CMakeLists.txt b/sigmod/test/CMakeLists.txt new file mode 100644 index 00000000..4e927feb --- /dev/null +++ b/sigmod/test/CMakeLists.txt @@ -0,0 +1,21 @@ +SET(sigmodtest_SRCS + TestSigmodObject.cpp +) + +KDE4_ADD_LIBRARY(sigmodtest + SHARED + ${sigmodtest_SRCS} +) +TARGET_LINK_LIBRARIES(sigmodtest + ${QT_QTCORE_LIBRARY} +) +TARGET_LINK_LIBRARIES(sigmodtest LINK_INTERFACE_LIBRARIES + ${QT_QTCORE_LIBRARY} +) + +SET(libraries + sigmod + sigmodtest +) + +MAKE_TEST(Ability libraries) diff --git a/sigmod/test/Global.h b/sigmod/test/Global.h new file mode 100644 index 00000000..08cfdda3 --- /dev/null +++ b/sigmod/test/Global.h @@ -0,0 +1,37 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef SIGMODTEST_GLOBAL +#define SIGMODTEST_GLOBAL + +// KDE includes +#include <kdemacros.h> + +#ifndef SIGMODTEST_EXPORT +# ifdef MAKE_SIGMODTEST_LIB +# define SIGMODTEST_EXPORT KDE_EXPORT /// Export the symbol if building the library. +# else +# define SIGMODTEST_EXPORT KDE_IMPORT /// Import the symbol if including the library. +# endif +# define SIGMODTEST_IMPORT KDE_IMPORT +#endif + +#ifndef SIGMODTEST_EXPORT_DEPRECATED +# define SIGMODTEST_EXPORT_DEPRECATED KDE_DEPRECATED SIGMODTEST_EXPORT /// Mark as deprecated +#endif + +#endif diff --git a/sigmod/test/TestAbility.cpp b/sigmod/test/TestAbility.cpp new file mode 100644 index 00000000..8ca93371 --- /dev/null +++ b/sigmod/test/TestAbility.cpp @@ -0,0 +1,84 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "TestAbility.h" + +// Qt includes +#include <QtTest/QTest> + +void TestAbility::initTestCases() +{ + TestSigmodObject::initTestCases(); +} + +void TestAbility::cleanupTestCases() +{ + TestSigmodObject::cleanupTestCases(); +} + +void TestAbility::init() +{ + TestSigmodObject::init(); +} + +void TestAbility::cleanup() +{ + TestSigmodObject::cleanup(); +} + +void TestAbility::validation() +{ +} + +void TestAbility::saving() +{ +} + +void TestAbility::loading() +{ +} + +void TestAbility::setName() +{ +} + +void TestAbility::setPriority() +{ +} + +void TestAbility::setDescription() +{ +} + +void TestAbility::setBattleScript() +{ +} + +void TestAbility::setWorldScript() +{ +} + +void TestAbility::setPriorityScript() +{ +} + +void TestAbility::assignment() +{ +} + +QTEST_APPLESS_MAIN(TestAbility) diff --git a/sigmod/test/TestAbility.h b/sigmod/test/TestAbility.h new file mode 100644 index 00000000..620a5dc6 --- /dev/null +++ b/sigmod/test/TestAbility.h @@ -0,0 +1,56 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef SIGMOD_TESTABILITY +#define SIGMOD_TESTABILITY + +// Test includes +#include "TestSigmodObject.h" + +// Sigmod includes +#include "../Ability.h" + +class TestAbility : public TestSigmodObject +{ + Q_OBJECT + + private slots: + void initTestCases(); + void cleanupTestCases(); + + void init(); + void cleanup(); + + void validation(); + void saving(); + void loading(); + + void setName(); + void setPriority(); + void setDescription(); + void setBattleScript(); + void setWorldScript(); + void setPriorityScript(); + + void assignment(); + private: + Sigmod::Ability* m_ability1; + Sigmod::Ability* m_ability2; + Sigmod::Ability* m_ability3; +}; + +#endif diff --git a/sigmod/test/TestSigmodObject.cpp b/sigmod/test/TestSigmodObject.cpp new file mode 100644 index 00000000..b0baa44d --- /dev/null +++ b/sigmod/test/TestSigmodObject.cpp @@ -0,0 +1,53 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "TestSigmodObject.h" + +void TestSigmodObject::message(const QString& message) +{ + m_messages.append(message); +} + +void TestSigmodObject::warning(const QString& warning) +{ + m_warnings.append(warning); +} + +void TestSigmodObject::error(const QString& error) +{ + m_errors.append(error); +} + +void TestSigmodObject::initTestCases() +{ +} + +void TestSigmodObject::cleanupTestCases() +{ +} + +void TestSigmodObject::init() +{ +} + +void TestSigmodObject::cleanup() +{ + m_messages.clear(); + m_warnings.clear(); + m_errors.clear(); +} diff --git a/sigmod/test/TestSigmodObject.h b/sigmod/test/TestSigmodObject.h new file mode 100644 index 00000000..9ec43f3a --- /dev/null +++ b/sigmod/test/TestSigmodObject.h @@ -0,0 +1,55 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef SIGMOD_TESTSIGMODOBJECT +#define SIGMOD_TESTSIGMODOBJECT + +// Test includes +#include "Global.h" + +// Qt includes +#include <QtCore/QList> +#include <QtCore/QObject> +#include <QtCore/QString> + +class SIGMODTEST_EXPORT TestSigmodObject : public QObject +{ + Q_OBJECT + + protected: + QList<QString> m_messages; + QList<QString> m_warnings; + QList<QString> m_errors; + protected slots: + void message(const QString& warning); + void warning(const QString& warning); + void error(const QString& warning); + + virtual void initTestCases(); + virtual void cleanupTestCases(); + + virtual void init(); + virtual void cleanup(); + + virtual void validation() = 0; + virtual void saving() = 0; + virtual void loading() = 0; + + virtual void assignment() = 0; +}; + +#endif |
