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())); }
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())); }