Commit cd96c580 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Adapt to KDE coding style

Already the code kind of follows this style. This fixes all those many
coding style typos by running clang-format with the default style.
parent 0b4512ec
......@@ -18,38 +18,36 @@ class AllPass1Test : public QObject
{
Q_OBJECT
private slots: //must be private
private slots: // must be private
/** Test that always passes*/
void testAlwaysPass1();
/** Test that always passes*/
void testAlwaysPass2();
};
void AllPass1Test::testAlwaysPass1()
{
QCOMPARE( true, true );
QCOMPARE(true, true);
}
void AllPass1Test::testAlwaysPass2()
{
//This just forces these to link and test the CMake file
// This just forces these to link and test the CMake file
MinimalTempVocDoc tempfile;
KEduVocDocument *docWithLock = new KEduVocDocument();
int docError = docWithLock->open(tempfile.fileName());
QCOMPARE( docError, int( KEduVocDocument::NoError ) );
QCOMPARE(docError, int(KEduVocDocument::NoError));
KUrl kurl = KUrl::fromPath(tempfile.fileName() );
//ParleyDocument *doc = new ParleyDocument(0);
KUrl kurl = KUrl::fromPath(tempfile.fileName());
// ParleyDocument *doc = new ParleyDocument(0);
QVERIFY( doc != NULL );
QVERIFY(doc != NULL);
}
QTEST_MAIN( AllPass1Test )
QTEST_MAIN(AllPass1Test)
#include "allpass1test.moc"
......@@ -16,27 +16,25 @@ class AllPass2Test : public QObject
{
Q_OBJECT
private slots: //must be private
private slots: // must be private
/** Test that always passes*/
void testAlwaysPass1();
/** Test that always passes*/
void testAlwaysPass2();
};
void AllPass2Test::testAlwaysPass1()
{
QCOMPARE( true, true );
QCOMPARE(true, true);
}
void AllPass2Test::testAlwaysPass2()
{
QCOMPARE( true, true );
QCOMPARE(true, true);
}
QTEST_APPLESS_MAIN( AllPass2Test )
QTEST_APPLESS_MAIN(AllPass2Test)
#include "allpass2test.moc"
......@@ -13,7 +13,7 @@ This file collects some utility classes that are used in multiple unit tests
using namespace UnitTestUtilities;
TemporaryVocDoc::TemporaryVocDoc()
:QTemporaryFile( QStringLiteral("XXXXXX.kvtml") )
: QTemporaryFile(QStringLiteral("XXXXXX.kvtml"))
{
this->open();
this->close();
......@@ -25,18 +25,18 @@ TemporaryVocDoc::~TemporaryVocDoc()
MinimalTempVocDoc::MinimalTempVocDoc()
{
const QString generator = QStringLiteral( "File Locking Unit Tests" );
const QString author = QStringLiteral( "File Locking Test" );
const QString lang = QStringLiteral( "File Locking Language Name" );
const QString locale = QStringLiteral( "en" ) ;
const QString generator = QStringLiteral("File Locking Unit Tests");
const QString author = QStringLiteral("File Locking Test");
const QString lang = QStringLiteral("File Locking Language Name");
const QString locale = QStringLiteral("en");
KEduVocIdentifier lang0;
lang0.setName( lang );
lang0.setLocale( locale);
lang0.setName(lang);
lang0.setLocale(locale);
KEduVocDocument *doc = new KEduVocDocument();
doc->setAuthor( author );
doc->appendIdentifier( lang0 );
doc->setAuthor(author);
doc->appendIdentifier(lang0);
doc->setGenerator(generator);
doc->saveAs(QUrl::fromLocalFile(fileName()), KEduVocDocument::Kvtml);
delete doc;
......
......@@ -8,7 +8,6 @@
This file collects some utility classes that are used in multiple unit tests
**/
#ifndef PARLEYUNITTESTUTILITIES_H
#define PARLEYUNITTESTUTILITIES_H
......@@ -18,18 +17,17 @@ This file collects some utility classes that are used in multiple unit tests
#include <QUrl>
#include <QTest>
#include <QDebug>
#include <QTest>
namespace UnitTestUtilities
{
/** Class to manage creation/destruction of a kvtml temp doc*/
class TemporaryVocDoc : public QTemporaryFile
{
public :
public:
/** Create the file, fix the suffix and instantiate it.*/
TemporaryVocDoc() ;
TemporaryVocDoc();
/** Destructor*/
~TemporaryVocDoc();
......@@ -38,7 +36,7 @@ public :
/** Creates a minimal doc that will save and load error free.*/
class MinimalTempVocDoc : public TemporaryVocDoc
{
public :
public:
/** The minimal doc has generator, author, lang and local */
MinimalTempVocDoc();
......@@ -47,4 +45,4 @@ public :
};
}
#endif //PARLEYUNITTESTUTILITIES_H
#endif // PARLEYUNITTESTUTILITIES_H
......@@ -4,36 +4,31 @@
*/
#include "sessionmanagerfixedtest.h"
#include "sessionmanagerfixed.h"
#include "prefs.h"
#include "documentsettings.h"
#include "prefs.h"
#include "sessionmanagerfixed.h"
#include <KEduVocDocument>
#include <KEduVocWordtype>
#include <QTest>
namespace SessionManagerFixedTests
{
void SessionManagerFixedTest::initTestCase()
{
// Prevent writing by tast case modified pareleys config file to current users configuration
QStandardPaths::setTestModeEnabled(true);
}
void SessionManagerFixedTest::cleanupTestCase()
{
if (QStandardPaths::isTestModeEnabled()) {
QFileInfo prefsFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation),
Prefs::self()->config()->name());
QFileInfo prefsFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation), Prefs::self()->config()->name());
if (prefsFile.exists()) {
QFile::remove(prefsFile.filePath());
}
}
}
void SessionManagerFixedTest::setupBasicPreferences() const
{
Prefs::setLearningLanguage(0);
......@@ -52,9 +47,7 @@ void SessionManagerFixedTest::setupBasicPreferences() const
Prefs::setSessionMaxSize(20);
}
void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument &doc,
int nEntries) const
void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument &doc, int nEntries) const
{
KEduVocWordType *root = doc.wordTypeContainer();
KEduVocWordType *noun = new KEduVocWordType(QStringLiteral("Noun"), root);
......@@ -89,15 +82,14 @@ void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument
doc.identifier(1).setName(QStringLiteral("Languge 1"));
doc.identifier(1).setLocale(QStringLiteral("l1"));
for (int i = 0; i < nEntries ; i++) {
for (int i = 0; i < nEntries; i++) {
KEduVocExpression *expression = new KEduVocExpression;
expression->setTranslation(0, QStringLiteral("translation 0 word %1").arg(i));
expression->setTranslation(1, QStringLiteral("translation 1 word %1").arg(i));
lesson->appendEntry(expression);
if (Prefs::practiceMode() == Prefs::EnumPracticeMode::GenderPractice) {
auto container = doc.wordTypeContainer()->childOfType(KEduVocWordFlag::Noun
| KEduVocWordFlag::Masculine);
auto container = doc.wordTypeContainer()->childOfType(KEduVocWordFlag::Noun | KEduVocWordFlag::Masculine);
expression->translation(0)->setWordType(container);
expression->translation(1)->setWordType(container);
......@@ -108,23 +100,17 @@ void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument
if (Prefs::practiceMode() == Prefs::EnumPracticeMode::ConjugationPractice) {
KEduVocConjugation conjugation0;
conjugation0.setConjugation(KEduVocText(QStringLiteral("conjugation %1 00").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation0.setConjugation(KEduVocText(QStringLiteral("conjugation %1 01").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation0.setConjugation(KEduVocText(QStringLiteral("conjugation %1 00").arg(i)), KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation0.setConjugation(KEduVocText(QStringLiteral("conjugation %1 01").arg(i)), KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation0.setConjugation(KEduVocText(QStringLiteral("conjugation %1 03").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
expression->translation(0)->setConjugation(QStringLiteral("tense"), conjugation0);
KEduVocConjugation conjugation1;
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation %1 10").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation %1 11").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation %1 10").arg(i)), KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation %1 11").arg(i)), KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation %1 13").arg(i)),
KEduVocWordFlag::Singular | KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
expression->translation(1)->setConjugation(QStringLiteral("tense"), conjugation1);
auto container = doc.wordTypeContainer()->childOfType(KEduVocWordFlag::Verb);
......@@ -137,14 +123,10 @@ void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument
}
if (Prefs::practiceMode() == Prefs::EnumPracticeMode::ComparisonPractice) {
expression->translation(0)->setComparativeForm(
KEduVocText(QStringLiteral("comparative %1 0").arg(i)));
expression->translation(0)->setSuperlativeForm(
KEduVocText(QStringLiteral("superlative %1 0").arg(i)));
expression->translation(1)->setComparativeForm(
KEduVocText(QStringLiteral("comparative %1 1").arg(i)));
expression->translation(1)->setSuperlativeForm(
KEduVocText(QStringLiteral("superlative %1 1").arg(i)));
expression->translation(0)->setComparativeForm(KEduVocText(QStringLiteral("comparative %1 0").arg(i)));
expression->translation(0)->setSuperlativeForm(KEduVocText(QStringLiteral("superlative %1 0").arg(i)));
expression->translation(1)->setComparativeForm(KEduVocText(QStringLiteral("comparative %1 1").arg(i)));
expression->translation(1)->setSuperlativeForm(KEduVocText(QStringLiteral("superlative %1 1").arg(i)));
auto container = doc.wordTypeContainer()->childOfType(KEduVocWordFlag::Adjective);
expression->translation(0)->setWordType(container);
......@@ -160,7 +142,6 @@ void SessionManagerFixedTest::initDocumentPracticeModeDependent(KEduVocDocument
doc.setModified(false);
}
void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_written()
{
constexpr int MAX_NUMBER_OF_NEW_WORDS = 5;
......@@ -180,7 +161,6 @@ void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_written()
QCOMPARE(sessionManager.allEntryCount(), MAX_NUMBER_OF_NEW_WORDS);
}
void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_gender()
{
constexpr int MAX_NUMBER_OF_NEW_WORDS = 5;
......@@ -200,7 +180,6 @@ void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_gender()
QCOMPARE(sessionManager.allEntryCount(), MAX_NUMBER_OF_NEW_WORDS);
}
void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_conjugation()
{
constexpr int MAX_NUMBER_OF_NEW_WORDS = 5;
......@@ -225,7 +204,6 @@ void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_conjugation
QCOMPARE(sessionManager.allEntryCount(), MAX_NUMBER_OF_NEW_WORDS);
}
void SessionManagerFixedTest::test_maximumNumberOfNewWordsPerSession_comparsion()
{
constexpr int MAX_NUMBER_OF_NEW_WORDS = 5;
......
......@@ -9,7 +9,8 @@
class KEduVocDocument;
namespace SessionManagerFixedTests {
namespace SessionManagerFixedTests
{
/** @file
* \brief SessionManagerFixedTest test application
* Various tests for SessionManagerFixed class.
......@@ -18,7 +19,7 @@ namespace SessionManagerFixedTests {
class SessionManagerFixedTest : public QObject
{
Q_OBJECT
Q_OBJECT
private slots:
void initTestCase();
......@@ -31,9 +32,7 @@ private slots:
private:
void setupBasicPreferences() const;
void initDocumentPracticeModeDependent(KEduVocDocument &doc, int nEntries) const;
};
}
#endif // SESSIONMANAGERFIXEDTEST_H
......@@ -4,12 +4,12 @@
*/
#include "testentrytest.h"
#include "testentry.h"
#include "prefs.h"
#include "testentry.h"
#include <QTest>
namespace TestEntryTests{
namespace TestEntryTests
{
void TestEntryTest::initTestCase()
{
/*
......@@ -48,7 +48,6 @@ void TestEntryTest::initTestCase()
QStandardPaths::setTestModeEnabled(true);
}
KEduVocExpression *TestEntryTest::makeKEduVocExpressionGrade()
{
KEduVocExpression *expression = new KEduVocExpression;
......@@ -70,9 +69,7 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionGrade()
conjugation0.setConjugation(text, KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
text.setText(QStringLiteral("conjugation 03"));
text.setGrade(KV_LEV5_GRADE);
conjugation0.setConjugation(text, KEduVocWordFlag::Singular
| KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
conjugation0.setConjugation(text, KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
translation0->setConjugation(QStringLiteral("tense"), conjugation0);
text.setText(QStringLiteral("comparative 0"));
......@@ -83,20 +80,15 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionGrade()
text.setGrade(KV_LEV7_GRADE);
translation0->setSuperlativeForm(text);
expression->setTranslation(1, QStringLiteral("translation 1"));
KEduVocTranslation *translation1 = expression->translation(1);
translation1->setArticle(KEduVocText());
KEduVocConjugation conjugation1;
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 10")),
KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 11")),
KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 13")),
KEduVocWordFlag::Singular | KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 10")), KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 11")), KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 13")), KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
translation1->setConjugation(QStringLiteral("tense"), conjugation1);
translation1->setComparativeForm(KEduVocText(QStringLiteral("comparative 1")));
......@@ -105,7 +97,6 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionGrade()
return expression;
}
KEduVocExpression *TestEntryTest::makeKEduVocExpressionPreGrade()
{
KEduVocExpression *expression = new KEduVocExpression;
......@@ -127,9 +118,7 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionPreGrade()
conjugation0.setConjugation(text, KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
text.setText(QStringLiteral("conjugation 03"));
text.setPreGrade(KV_LEV5_GRADE);
conjugation0.setConjugation(text, KEduVocWordFlag::Singular
| KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
conjugation0.setConjugation(text, KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
translation0->setConjugation(QStringLiteral("tense"), conjugation0);
text.setText(QStringLiteral("comparative 0"));
......@@ -140,20 +129,15 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionPreGrade()
text.setPreGrade(KV_LEV7_GRADE);
translation0->setSuperlativeForm(text);
expression->setTranslation(1, QStringLiteral("translation 1"));
KEduVocTranslation *translation1 = expression->translation(1);
translation1->setArticle(KEduVocText());
KEduVocConjugation conjugation1;
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 10")),
KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 11")),
KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 13")),
KEduVocWordFlag::Singular | KEduVocWordFlag::Third
| KEduVocWordFlag::Neuter);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 10")), KEduVocWordFlag::Singular | KEduVocWordFlag::First);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 11")), KEduVocWordFlag::Singular | KEduVocWordFlag::Second);
conjugation1.setConjugation(KEduVocText(QStringLiteral("conjugation 13")), KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter);
translation1->setConjugation(QStringLiteral("tense"), conjugation1);
translation1->setComparativeForm(KEduVocText(QStringLiteral("comparative 1")));
......@@ -162,23 +146,19 @@ KEduVocExpression *TestEntryTest::makeKEduVocExpressionPreGrade()
return expression;
}
TestEntry *TestEntryTest::makeTestEntry(KEduVocExpression *expression)
{
TestEntry *testEntry = new TestEntry(expression);
testEntry->setLanguageTo(0);
testEntry->setLanguageFrom(1);
testEntry->setConjugationTense(QStringLiteral("tense"));
testEntry->setConjugationPronouns({
KEduVocWordFlag::Singular | KEduVocWordFlag::First,
KEduVocWordFlag::Singular | KEduVocWordFlag::Second,
KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter
});
testEntry->setConjugationPronouns({KEduVocWordFlag::Singular | KEduVocWordFlag::First,
KEduVocWordFlag::Singular | KEduVocWordFlag::Second,
KEduVocWordFlag::Singular | KEduVocWordFlag::Third | KEduVocWordFlag::Neuter});
return testEntry;
}
void TestEntryTest::cleanupTestCase()
{
delete m_gradeTestEntry;
......@@ -188,140 +168,107 @@ void TestEntryTest::cleanupTestCase()
// Remove temporary parley config file
if (QStandardPaths::isTestModeEnabled()) {
QFileInfo prefsFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation),
Prefs::self()->config()->name());
QFileInfo prefsFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation), Prefs::self()->config()->name());
if (prefsFile.exists()) {
QFile::remove(prefsFile.filePath());
}
}
}
void TestEntryTest::test_practiceModeDependentMinGrade_written()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::WrittenPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(),
static_cast<grade_t>(KV_LEV1_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(), static_cast<grade_t>(KV_LEV1_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinGrade_gender()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::GenderPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(),
static_cast<grade_t>(KV_LEV2_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(), static_cast<grade_t>(KV_LEV2_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinGrade_conjugation()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ConjugationPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(),
static_cast<grade_t>(KV_LEV3_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(), static_cast<grade_t>(KV_LEV3_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinGrade_comparsion()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ComparisonPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(),
static_cast<grade_t>(KV_LEV6_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMinGrade(), static_cast<grade_t>(KV_LEV6_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxGrade_written()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::WrittenPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(),
static_cast<grade_t>(KV_LEV1_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(), static_cast<grade_t>(KV_LEV1_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxGrade_gender()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::GenderPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(),
static_cast<grade_t>(KV_LEV2_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(), static_cast<grade_t>(KV_LEV2_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxGrade_conjugation()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ConjugationPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(),
static_cast<grade_t>(KV_LEV5_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(), static_cast<grade_t>(KV_LEV5_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxGrade_comparsion()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ComparisonPractice);
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(),
static_cast<grade_t>(KV_LEV7_GRADE));
QCOMPARE(m_gradeTestEntry->practiceModeDependentMaxGrade(), static_cast<grade_t>(KV_LEV7_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinPreGrade_written()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::WrittenPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(),
static_cast<grade_t>(KV_LEV1_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(), static_cast<grade_t>(KV_LEV1_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinPreGrade_gender()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::GenderPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(),
static_cast<grade_t>(KV_LEV2_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(), static_cast<grade_t>(KV_LEV2_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinPreGrade_conjugation()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ConjugationPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(),
static_cast<grade_t>(KV_LEV3_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(), static_cast<grade_t>(KV_LEV3_GRADE));
}
void TestEntryTest::test_practiceModeDependentMinPreGrade_comparsion()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ComparisonPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(),
static_cast<grade_t>(KV_LEV6_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMinPreGrade(), static_cast<grade_t>(KV_LEV6_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxPreGrade_written()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::WrittenPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(),
static_cast<grade_t>(KV_LEV1_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(), static_cast<grade_t>(KV_LEV1_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxPreGrade_gender()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::GenderPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(),
static_cast<grade_t>(KV_LEV2_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(), static_cast<grade_t>(KV_LEV2_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxPreGrade_conjugation()
{
Prefs::setPracticeMode(Prefs::EnumPracticeMode::ConjugationPractice);
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(),
static_cast<grade_t>(KV_LEV5_GRADE));
QCOMPARE(m_preGradeTestEntry->practiceModeDependentMaxPreGrade(), static_cast<grade_t>(KV_LEV5_GRADE));
}
void TestEntryTest::test_practiceModeDependentMaxPreGrade_comparsion()
{