Пример #1
0
void test_CSwordVerseKey::CSwordVerseKey_versekey_module_constructor() {

    CSwordVerseKey* key = nullptr;
    try {
        key = new CSwordVerseKey(m_moduleKJVA);
        key->setKey("Matthew 15:39");
    }
    catch (...) {
        QFAIL("constructor failed");
    }

    CSwordVerseKey* key2 = nullptr;
    try {
        key2 = new CSwordVerseKey(key,m_moduleKJV);
        key2->setKey("Matthew 15:39");
    }
    catch (...) {
        QFAIL("constructor failed");
    }
    QCOMPARE(QString(key2->getBookName()), QString(key->getBookName()));
    QCOMPARE(QString(key2->getChapter()), QString(key->getChapter()));
    QCOMPARE(QString(key2->getVerse()), QString(key->getVerse()));


}
Пример #2
0
// Also tests key()
void test_CSwordVerseKey::setKey() {
    QFETCH(QString, moduleName);
    QFETCH(QString, reference);

    CSwordBackend* backend = CSwordBackend::instance();
    CSwordModuleInfo* module = backend->findModuleByName(moduleName);
    QVERIFY(module != 0);
    CSwordVerseKey* vKey = dynamic_cast<CSwordVerseKey*>(CSwordKey::createInstance(module));

    vKey->setKey(reference);
    QString newKey = vKey->key();
    QCOMPARE(newKey, reference);
}
Пример #3
0
void test_CSwordVerseKey::CSwordVerseKey_copy_constructor() {

    CSwordVerseKey* key = nullptr;
    try {
        key = new CSwordVerseKey(m_moduleKJVA);
        key->setKey("II Maccabees 15:39");
    }
    catch (...) {
        QFAIL("constructor failed");
    }

    const CSwordVerseKey* copyKey = new CSwordVerseKey(*key);
    QCOMPARE(QString(copyKey->getBookName()), QString(key->getBookName()));
    QCOMPARE(QString(copyKey->getChapter()), QString(key->getChapter()));
    QCOMPARE(QString(copyKey->getVerse()), QString(key->getVerse()));
}