Commit b1a45315 authored by Lukas Appelhans's avatar Lukas Appelhans

Add simple error test

parent 0f2fd571
......@@ -39,4 +39,17 @@ if(CMAKE_BUILD_TYPE MATCHES debugfull)
target_link_libraries(akabei_group_test ${QT_QTTEST_LIBRARY} akabeicore)
add_test(akabei akabei_group_test)
#Error test
set(akabei_error_test_SRCS
akabeierrortest.cpp
)
qt4_wrap_cpp(akabei_error_test_MOC_SRCS akabeierrortest.h)
add_executable(akabei_error_test ${akabei_error_test_SRCS} ${akabei_error_test_MOC_SRCS})
target_link_libraries(akabei_error_test ${QT_QTTEST_LIBRARY} akabeicore)
add_test(akabei akabei_error_test)
endif(CMAKE_BUILD_TYPE MATCHES debugfull)
/* This file is part of the Chakra project
Copyright (C) 2011 Lukas Appelhans
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include "akabeierrortest.h"
#include <QTest>
#include <akabeierror.h>
AkabeiErrorTest::AkabeiErrorTest(QObject * parent) : QObject(parent)
{
}
void AkabeiErrorTest::test()
{
Akabei::Error::Type type = Akabei::Error::DuplicateTargetError;
const QString &desc = "foobar";
Akabei::Error * e = new Akabei::Error(type, desc);
QVERIFY(e->description() == desc);
QVERIFY(e->type() == type);
QVERIFY(e->targets().isEmpty());
QVERIFY(!e->operation());
}
QTEST_MAIN(AkabeiErrorTest)
/* This file is part of the Chakra project
Copyright (C) 2011 Lukas Appelhans
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#ifndef AKABEIERRORTEST_H
#define AKABEIERRORTEST_H
#include <QtCore/QObject>
class AkabeiErrorTest : public QObject
{
Q_OBJECT
public:
AkabeiErrorTest(QObject * parent = 0);
private slots:
void test();
};
#endif // AKABEIERRORTEST_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment