GUITEST: Add first GUI test testing TranslationHandler.

This commit is contained in:
Kimmo Varis 2011-02-08 23:30:46 +02:00
parent 83f43d8ab6
commit 2684b230f1
5 changed files with 36 additions and 1 deletions

10
gui/test/test.pro Normal file
View File

@ -0,0 +1,10 @@
TEMPLATE = app
TARGET =
CONFIG += qtestlib
DEPENDPATH += . ..
INCLUDEPATH += . ..
SOURCES += testtranslationhandler.cpp
HEADERS += ../translationhandler.h
SOURCES += ../translationhandler.cpp

View File

@ -0,0 +1,21 @@
#include <QtTest>
#include <QObject>
#include "translationhandler.h"
class TestTranslationHandler: public QObject
{
Q_OBJECT
private slots:
void construct();
};
void TestTranslationHandler::construct()
{
TranslationHandler handler;
QCOMPARE(10, handler.GetNames().size());
QCOMPARE(QString("en"), handler.GetCurrentLanguage());
}
#include "testtranslationhandler.moc"
QTEST_MAIN(TestTranslationHandler)

View File

@ -63,7 +63,7 @@ class TranslationHandler : QObject
{
Q_OBJECT
public:
TranslationHandler(QObject *parent);
TranslationHandler(QObject *parent = 0);
virtual ~TranslationHandler();
/**

View File

@ -7,6 +7,8 @@ astyle $style $options cli/*.cpp
astyle $style $options cli/*.h
astyle $style $options gui/*.cpp
astyle $style $options gui/*.h
astyle $style $options gui/test/*.cpp
astyle $style $options gui/test/*.h
astyle $style $options lib/*.cpp
astyle $style $options lib/*.h
astyle $style $options test/*.cpp

View File

@ -7,6 +7,8 @@ astyle %STYLE% %OPTIONS% cli/*.cpp
astyle %STYLE% %OPTIONS% cli/*.h
astyle %STYLE% %OPTIONS% gui/*.cpp
astyle %STYLE% %OPTIONS% gui/*.h
astyle %STYLE% %OPTIONS% gui/test/*.cpp
astyle %STYLE% %OPTIONS% gui/test/*.h
astyle %STYLE% %OPTIONS% lib/*.cpp
astyle %STYLE% %OPTIONS% lib/*.h
astyle %STYLE% %OPTIONS% test/*.cpp