diff --git a/autotests/resourcetests/CMakeLists.txt b/autotests/resourcetests/CMakeLists.txt index 701bf94..ac5ab51 100644 --- a/autotests/resourcetests/CMakeLists.txt +++ b/autotests/resourcetests/CMakeLists.txt @@ -1,44 +1,58 @@ ### # Copyright 2013-2019 Andreas Cord-Landwehr # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### include_directories( ../../src/ ../../ ../mocks/ ${CMAKE_CURRENT_BINARY_DIR} ) # basic tests language resource conformance with XSD set(TestLanguageFiles_SRCS languageresources/testlanguagefiles.cpp ) qt5_add_resources(TestLanguageFiles_SRCS ../../data/languages.qrc) add_executable(test_languageresources ${TestLanguageFiles_SRCS} ) target_link_libraries(test_languageresources artikulatecore Qt5::Test ) add_test(NAME test_languageresources COMMAND test_languageresources) ecm_mark_as_test(test_languageresources) + + +# test correctness of XSD files +set(TestXsdSchemes_SRCS + xsdschemes/testxsdschemes.cpp +) +add_executable(test_xsdschemes ${TestXsdSchemes_SRCS} ) +target_link_libraries(test_xsdschemes + Qt5::Test + Qt5::XmlPatterns + Qt5::Core +) +add_test(NAME test_xsdschemes COMMAND test_xsdschemes) +ecm_mark_as_test(test_xsdschemes) diff --git a/autotests/resourcetests/xsdschemes/testxsdschemes.cpp b/autotests/resourcetests/xsdschemes/testxsdschemes.cpp new file mode 100644 index 0000000..0c00a01 --- /dev/null +++ b/autotests/resourcetests/xsdschemes/testxsdschemes.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2013 Oindrila Gupta + * + * 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 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * 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 . + */ + +#include "testxsdschemes.h" + +#include +#include +#include +#include +#include + +TestXsdSchemes::TestXsdSchemes() +{ +} + +void TestXsdSchemes::init() +{ + // TODO initialization of test case +} + +void TestXsdSchemes::cleanup() +{ + // TODO cleanup after test run +} + +void TestXsdSchemes::languageSchemeValidationTest() +{ + QUrl languageFile = QUrl::fromLocalFile(":/artikulate/schemes/language.xsd"); + QXmlSchema languageSchema; + QVERIFY(languageSchema.load(languageFile)); + QVERIFY(languageSchema.isValid()); +} + +void TestXsdSchemes::courseSchemeValidationTest() +{ + QUrl schemeFile = QUrl::fromLocalFile(":/artikulate/schemes/course.xsd"); + QXmlSchema courseSchema; + QVERIFY(courseSchema.load(schemeFile)); + QVERIFY(courseSchema.isValid()); +} + +void TestXsdSchemes::schemeValidationTest() +{ + QUrl skeletonFile = QUrl::fromLocalFile(":/artikulate/schemes/skeleton.xsd"); + QXmlSchema skeletonScheme; + QVERIFY(skeletonScheme.load(skeletonFile)); + QVERIFY(skeletonScheme.isValid()); +} + +QTEST_GUILESS_MAIN(TestXsdSchemes) diff --git a/autotests/unittests/courseresource/test_courseresource.h b/autotests/resourcetests/xsdschemes/testxsdschemes.h similarity index 62% copy from autotests/unittests/courseresource/test_courseresource.h copy to autotests/resourcetests/xsdschemes/testxsdschemes.h index 9ce1930..dcf0b90 100644 --- a/autotests/unittests/courseresource/test_courseresource.h +++ b/autotests/resourcetests/xsdschemes/testxsdschemes.h @@ -1,69 +1,60 @@ /* - * Copyright 2013-2019 Andreas Cord-Landwehr + * Copyright 2019 Andreas Cord-Landwehr * * 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 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 . */ -#ifndef TESTCOURSERESOURCE_H -#define TESTCOURSERESOURCE_H +#ifndef TESTXSDSCHEMES_H +#define TESTXSDSCHEMES_H #include -#include -class TestCourseResource : public QObject +class TestXsdSchemes : public QObject { Q_OBJECT public: - TestCourseResource(); + TestXsdSchemes(); private slots: /** - * @brief Called before every test case. + * Called before every test case. */ void init(); /** - * @brief Called after every test case. + * Called after every test case. */ void cleanup(); /** - * @brief Test if course XSD specification is valid. - */ - void courseSchemeValidationTest(); - - /** - * @brief Test simple loading of course resource XML file + * @brief Test if language XSD specification is valid. */ - void loadCourseResource(); + void languageSchemeValidationTest(); /** - * @brief Test handling of unit insertions (specifically, the signals) + * @brief Test if course XSD specification is valid. */ - void unitAddAndRemoveHandling(); + void courseSchemeValidationTest(); /** - * @brief Test of all course property changes except unit handling + * @brief Test if course XSD specification is valid. */ - void coursePropertyChanges(); - -private: - bool m_systemUseCourseRepositoryValue; + void schemeValidationTest(); }; #endif diff --git a/autotests/unittests/courseresource/test_courseresource.cpp b/autotests/unittests/courseresource/test_courseresource.cpp index 19cb036..a26fd33 100644 --- a/autotests/unittests/courseresource/test_courseresource.cpp +++ b/autotests/unittests/courseresource/test_courseresource.cpp @@ -1,205 +1,197 @@ /* * Copyright 2013 Andreas Cord-Landwehr * * 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 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 . */ #include "test_courseresource.h" #include "resourcerepositorystub.h" #include "core/language.h" #include "core/unit.h" #include "core/phrase.h" #include "core/phonemegroup.h" #include "core/resources/languageresource.h" #include "core/resources/courseresource.h" #include #include #include #include #include #include #include #include #include TestCourseResource::TestCourseResource() { } void TestCourseResource::init() { } void TestCourseResource::cleanup() { } -void TestCourseResource::courseSchemeValidationTest() -{ - QUrl schemeFile = QUrl::fromLocalFile(":/artikulate/schemes/course.xsd"); - QXmlSchema courseSchema; - QVERIFY(courseSchema.load(schemeFile)); - QVERIFY(courseSchema.isValid()); -} - void TestCourseResource::loadCourseResource() { std::unique_ptr language(new Language); language->setId("de"); auto group = language->addPhonemeGroup("id", "title"); group->addPhoneme("g", "G"); group->addPhoneme("u", "U"); std::vector> languages; languages.push_back(std::move(language)); ResourceRepositoryStub repository(std::move(languages)); const QString courseDirectory = "data/courses/de/"; const QString courseFile = courseDirectory + "de.xml"; CourseResource course(QUrl::fromLocalFile(courseFile), &repository); QCOMPARE(course.file().toLocalFile(), courseFile); QCOMPARE(course.id(), "de"); QCOMPARE(course.foreignId(), "artikulate-basic"); QCOMPARE(course.title(), "Artikulate Deutsch"); QCOMPARE(course.description(), "Ein Kurs in (hoch-)deutscher Aussprache."); QVERIFY(course.language() != nullptr); QCOMPARE(course.language()->id(), "de"); QCOMPARE(course.units().count(), 1); const auto unit = course.units().first(); QVERIFY(unit != nullptr); QCOMPARE(unit->id(), "1"); QCOMPARE(unit->title(), QStringLiteral("Auf der Straße")); QCOMPARE(unit->foreignId(), "{dd60f04a-eb37-44b7-9787-67aaf7d3578d}"); QCOMPARE(unit->phraseList().count(), 3); // note: this test takes the silent assumption that phrases are added to the list in same // order as they are defined in the file. This assumption should be made explicit or dropped const auto firstPhrase = unit->phraseList().first(); QVERIFY(firstPhrase != nullptr); QCOMPARE(firstPhrase->id(), "1"); QCOMPARE(firstPhrase->foreignId(), "{3a4c1926-60d7-44c6-80d1-03165a641c75}"); QCOMPARE(firstPhrase->text(), "Guten Tag."); QCOMPARE(firstPhrase->soundFileUrl(), courseDirectory + "de_01.ogg"); QCOMPARE(firstPhrase->type(), Phrase::Type::Sentence); QCOMPARE(firstPhrase->phonemes().count(), 2); } void TestCourseResource::unitAddAndRemoveHandling() { // boilerplate std::unique_ptr language(new Language); language->setId("de"); std::vector> languages; languages.push_back(std::move(language)); ResourceRepositoryStub repository(std::move(languages)); const QString courseDirectory = "data/courses/de/"; const QString courseFile = courseDirectory + "de.xml"; CourseResource course(QUrl::fromLocalFile(courseFile), &repository); // begin of test std::unique_ptr unit(new Unit); unit->setId("testunit"); const int initialUnitNumber = course.units().count(); QCOMPARE(initialUnitNumber, 1); QSignalSpy spyAboutToBeAdded(&course, SIGNAL(unitAboutToBeAdded(std::shared_ptr, int))); QSignalSpy spyAdded(&course, SIGNAL(unitAdded())); QCOMPARE(spyAboutToBeAdded.count(), 0); QCOMPARE(spyAdded.count(), 0); course.addUnit(std::move(unit)); QCOMPARE(course.units().count(), initialUnitNumber + 1); QCOMPARE(spyAboutToBeAdded.count(), 1); QCOMPARE(spyAdded.count(), 1); } void TestCourseResource::coursePropertyChanges() { // boilerplate std::unique_ptr language(new Language); language->setId("de"); std::vector> languages; languages.push_back(std::move(language)); ResourceRepositoryStub repository(std::move(languages)); const QString courseDirectory = "data/courses/de/"; const QString courseFile = courseDirectory + "de.xml"; CourseResource course(QUrl::fromLocalFile(courseFile), &repository); // id { const QString value = "newId"; QSignalSpy spy(&course, SIGNAL(idChanged())); QCOMPARE(spy.count(), 0); course.setId(value); QCOMPARE(course.id(), value); QCOMPARE(spy.count(), 1); } // foreign id { const QString value = "newForeignId"; QSignalSpy spy(&course, SIGNAL(foreignIdChanged())); QCOMPARE(spy.count(), 0); course.setForeignId(value); QCOMPARE(course.foreignId(), value); QCOMPARE(spy.count(), 1); } // title { const QString value = "newTitle"; QSignalSpy spy(&course, SIGNAL(titleChanged())); QCOMPARE(spy.count(), 0); course.setTitle(value); QCOMPARE(course.title(), value); QCOMPARE(spy.count(), 1); } // title { const QString value = "newI18nTitle"; QSignalSpy spy(&course, SIGNAL(i18nTitleChanged())); QCOMPARE(spy.count(), 0); course.setI18nTitle(value); QCOMPARE(course.i18nTitle(), value); QCOMPARE(spy.count(), 1); } // description { const QString value = "newDescription"; QSignalSpy spy(&course, SIGNAL(descriptionChanged())); QCOMPARE(spy.count(), 0); course.setDescription(value); QCOMPARE(course.description(), value); QCOMPARE(spy.count(), 1); } // language { std::shared_ptr testLanguage; QSignalSpy spy(&course, SIGNAL(languageChanged())); QCOMPARE(spy.count(), 0); course.setLanguage(testLanguage); QCOMPARE(course.language(), testLanguage); QCOMPARE(spy.count(), 1); } } QTEST_GUILESS_MAIN(TestCourseResource) diff --git a/autotests/unittests/courseresource/test_courseresource.h b/autotests/unittests/courseresource/test_courseresource.h index 9ce1930..4a5591d 100644 --- a/autotests/unittests/courseresource/test_courseresource.h +++ b/autotests/unittests/courseresource/test_courseresource.h @@ -1,69 +1,64 @@ /* * Copyright 2013-2019 Andreas Cord-Landwehr * * 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 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 . */ #ifndef TESTCOURSERESOURCE_H #define TESTCOURSERESOURCE_H #include #include class TestCourseResource : public QObject { Q_OBJECT public: TestCourseResource(); private slots: /** * @brief Called before every test case. */ void init(); /** * @brief Called after every test case. */ void cleanup(); - /** - * @brief Test if course XSD specification is valid. - */ - void courseSchemeValidationTest(); - /** * @brief Test simple loading of course resource XML file */ void loadCourseResource(); /** * @brief Test handling of unit insertions (specifically, the signals) */ void unitAddAndRemoveHandling(); /** * @brief Test of all course property changes except unit handling */ void coursePropertyChanges(); private: bool m_systemUseCourseRepositoryValue; }; #endif diff --git a/autotests/unittests/skeletonresource/test_skeletonresource.cpp b/autotests/unittests/skeletonresource/test_skeletonresource.cpp index 571ac5b..f11897d 100644 --- a/autotests/unittests/skeletonresource/test_skeletonresource.cpp +++ b/autotests/unittests/skeletonresource/test_skeletonresource.cpp @@ -1,212 +1,204 @@ /* * Copyright 2019 Andreas Cord-Landwehr * * 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 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 . */ #include "test_skeletonresource.h" #include "resourcerepositorystub.h" #include "core/language.h" #include "core/unit.h" #include "core/phrase.h" #include "core/resources/languageresource.h" #include "core/resources/skeletonresource.h" #include #include #include #include #include #include #include #include #include TestSkeletonResource::TestSkeletonResource() { } void TestSkeletonResource::init() { } void TestSkeletonResource::cleanup() { } -void TestSkeletonResource::schemeValidationTest() -{ - QUrl skeletonFile = QUrl::fromLocalFile(":/artikulate/schemes/skeleton.xsd"); - QXmlSchema skeletonScheme; - QVERIFY(skeletonScheme.load(skeletonFile)); - QVERIFY(skeletonScheme.isValid()); -} - void TestSkeletonResource::loadSkeletonResource() { std::shared_ptr language(new Language); language->setId("de"); ResourceRepositoryStub repository({language}); const QString courseDirectory = "data/contributorrepository/skeletons/"; const QString courseFile = courseDirectory + "skeleton.xml"; SkeletonResource course(QUrl::fromLocalFile(courseFile), &repository); QCOMPARE(course.file().toLocalFile(), courseFile); QCOMPARE(course.id(), "skeleton-testdata"); QCOMPARE(course.foreignId(), "skeleton-testdata"); // always same as ID QCOMPARE(course.title(), "Artikulate Test Course Title"); QCOMPARE(course.description(), "Artikulate Test Course Description"); QVERIFY(course.language() == nullptr); // a skeleton must not have a language QCOMPARE(course.units().count(), 2); const auto unit = course.units().first(); QVERIFY(unit != nullptr); QCOMPARE(unit->id(), "{11111111-b885-4833-97ff-27cb1ca2f543}"); QCOMPARE(unit->title(), QStringLiteral("Numbers")); QCOMPARE(unit->phraseList().count(), 2); // note: this test takes the silent assumption that phrases are added to the list in same // order as they are defined in the file. This assumption should be made explicit or dropped const auto firstPhrase = unit->phraseList().first(); QVERIFY(firstPhrase != nullptr); QCOMPARE(firstPhrase->id(), "{22222222-9234-4da5-a6fe-dbd5104f57d5}"); QCOMPARE(firstPhrase->text(), "0"); QCOMPARE(firstPhrase->type(), Phrase::Type::Word); const auto secondPhrase = unit->phraseList().at(1); QVERIFY(secondPhrase != nullptr); QCOMPARE(secondPhrase->id(), "{333333333-b4a9-4264-9a26-75a55aa5d302}"); QCOMPARE(secondPhrase->text(), "1"); QCOMPARE(secondPhrase->type(), Phrase::Type::Word); } void TestSkeletonResource::unitAddAndRemoveHandling() { // boilerplate std::shared_ptr language(new Language); language->setId("de"); ResourceRepositoryStub repository({language}); const QString courseDirectory = "data/contributorrepository/skeletons/"; const QString courseFile = courseDirectory + "skeleton.xml"; SkeletonResource course(QUrl::fromLocalFile(courseFile), &repository); // begin of test std::unique_ptr unit(new Unit); unit->setId("testunit"); const int initialUnitNumber = course.units().count(); QCOMPARE(initialUnitNumber, 2); QSignalSpy spyAboutToBeAdded(&course, SIGNAL(unitAboutToBeAdded(std::shared_ptr, int))); QSignalSpy spyAdded(&course, SIGNAL(unitAdded())); QCOMPARE(spyAboutToBeAdded.count(), 0); QCOMPARE(spyAdded.count(), 0); course.addUnit(std::move(unit)); QCOMPARE(course.units().count(), initialUnitNumber + 1); QCOMPARE(spyAboutToBeAdded.count(), 1); QCOMPARE(spyAdded.count(), 1); } void TestSkeletonResource::coursePropertyChanges() { // boilerplate std::shared_ptr language(new Language); language->setId("de"); ResourceRepositoryStub repository({language}); const QString courseDirectory = "data/contributorrepository/skeletons/"; const QString courseFile = courseDirectory + "skeleton.xml"; SkeletonResource course(QUrl::fromLocalFile(courseFile), &repository); // id { const QString value = "newId"; QSignalSpy spy(&course, SIGNAL(idChanged())); QCOMPARE(spy.count(), 0); course.setId(value); QCOMPARE(course.id(), value); QCOMPARE(spy.count(), 1); } // title { const QString value = "newTitle"; QSignalSpy spy(&course, SIGNAL(titleChanged())); QCOMPARE(spy.count(), 0); course.setTitle(value); QCOMPARE(course.title(), value); QCOMPARE(spy.count(), 1); } // description { const QString value = "newDescription"; QSignalSpy spy(&course, SIGNAL(descriptionChanged())); QCOMPARE(spy.count(), 0); course.setDescription(value); QCOMPARE(course.description(), value); QCOMPARE(spy.count(), 1); } } void TestSkeletonResource::fileLoadSaveCompleteness() { // boilerplate std::shared_ptr language(new Language); language->setId("de"); ResourceRepositoryStub repository({language}); const QString courseDirectory = "data/contributorrepository/skeletons/"; const QString courseFile = courseDirectory + "skeleton.xml"; SkeletonResource course(QUrl::fromLocalFile(courseFile), &repository); QTemporaryFile outputFile; outputFile.open(); course.exportCourse(QUrl::fromLocalFile(outputFile.fileName())); // note: this only works, since the resource manager not checks uniqueness of course ids! SkeletonResource loadedCourse(QUrl::fromLocalFile(outputFile.fileName()), &repository); // test that we actually call the different files QVERIFY(course.file().toLocalFile() != loadedCourse.file().toLocalFile()); QCOMPARE(loadedCourse.id(), course.id()); QCOMPARE(loadedCourse.foreignId(), course.foreignId()); QCOMPARE(loadedCourse.title(), course.title()); QCOMPARE(loadedCourse.description(), course.description()); QCOMPARE(loadedCourse.language(), course.language()); QCOMPARE(loadedCourse.units().count(), course.units().count()); auto testUnit = course.units().constFirst(); auto compareUnit = loadedCourse.units().constFirst(); QCOMPARE(testUnit->id(), compareUnit->id()); QCOMPARE(testUnit->foreignId(), compareUnit->foreignId()); QCOMPARE(testUnit->title(), compareUnit->title()); QCOMPARE(testUnit->phraseList().count(), compareUnit->phraseList().count()); Phrase *testPhrase = testUnit->phraseList().constFirst(); Phrase *comparePhrase = new Phrase(this); // note that this actually means that we DO NOT respect phrase orders by list order for (Phrase *phrase : compareUnit->phraseList()) { if (testPhrase->id() == phrase->id()) { comparePhrase = phrase; break; } } QVERIFY(testPhrase->id() == comparePhrase->id()); QVERIFY(testPhrase->foreignId() == comparePhrase->foreignId()); QVERIFY(testPhrase->text() == comparePhrase->text()); QVERIFY(testPhrase->type() == comparePhrase->type()); QVERIFY(testPhrase->sound().fileName() == comparePhrase->sound().fileName()); QVERIFY(testPhrase->phonemes().count() == comparePhrase->phonemes().count()); } QTEST_GUILESS_MAIN(TestSkeletonResource) diff --git a/autotests/unittests/skeletonresource/test_skeletonresource.h b/autotests/unittests/skeletonresource/test_skeletonresource.h index 7fede40..81abbf0 100644 --- a/autotests/unittests/skeletonresource/test_skeletonresource.h +++ b/autotests/unittests/skeletonresource/test_skeletonresource.h @@ -1,75 +1,70 @@ /* * Copyright 2013-2019 Andreas Cord-Landwehr * * 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 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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 . */ #ifndef TESTSKELETONRESOURCE_H #define TESTSKELETONRESOURCE_H #include #include class TestSkeletonResource : public QObject { Q_OBJECT public: TestSkeletonResource(); private slots: /** * @brief Called before every test case. */ void init(); /** * @brief Called after every test case. */ void cleanup(); - /** - * @brief Test if course XSD specification is valid. - */ - void schemeValidationTest(); - /** * @brief Test simple loading of course resource XML file */ void loadSkeletonResource(); /** * @brief Test handling of unit insertions (specifically, the signals) */ void unitAddAndRemoveHandling(); /** * @brief Test of all course property changes except unit handling */ void coursePropertyChanges(); /** * Test if serialization of unserialized file gives original file. * TODO this is a test by only string equality and should improved to test on a data level */ void fileLoadSaveCompleteness(); private: bool m_systemUseCourseRepositoryValue; }; #endif