+include(../qmake-target-platform.pri)
+include(../qmake-destination-path.pri)
QT += testlib
QT -= gui
CONFIG -= app_bundle
TEMPLATE = app
-include(../qmake-destination-path.pri)
-include(../qmake-target-platform.pri)
INCLUDEPATH += ../splittermond-assistant/src
DEPENDPATH += ../splittermond-assistant/src
-SOURCES += tst_test.cpp
+SOURCES += tst_test.cpp \
+ ../splittermond-assistant/src/character.cpp
DESTDIR = $$PWD/../binaries/$$DESTINATION_PATH
OBJECTS_DIR = $$PWD/build/$$DESTINATION_PATH/.obj
MOC_DIR = $$PWD/build/$$DESTINATION_PATH/.moc
RCC_DIR = $$PWD/build/$$DESTINATION_PATH/.qrc
UI_DIR = $$PWD/build/$$DESTINATION_PATH/.ui
+message(splittermond-assistant-test output dir: $${DESTDIR})
+message(splittermond-assistant-test project dir: $${PWD})
private slots:
void initTestCase();
void cleanupTestCase();
- void test_case1();
+ void init_Character();
};
}
-void Test::test_case1()
+void Test::init_Character()
{
- QVERIFY_EXCEPTION_THROWN (sm::data::Character c{12, 12}, std::invalid_argument);
+ QVERIFY_EXCEPTION_THROWN (sm::data::Character c ({12, 12}), std::invalid_argument);
+ sm::data::Character c ({9, 9, 9, 9, 9, 9, 9, 9, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 10});
+ QVERIFY ( c.skill (sm::data::Skill::heal) == 8);
+ QVERIFY ( c.attribute (sm::data::Attribute::mind) == 9);
+ QVERIFY ( c.life() == 10);
+ QVERIFY_EXCEPTION_THROWN (sm::data::Character c ({9, 9, 9, 9, 9, 9, 9, 9, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 10, 11}), std::invalid_argument);
}
QTEST_APPLESS_MAIN (Test)