Commit 42de5463 authored by Laurent Montel's avatar Laurent Montel 😁

Reactivate autotests build. Fix pedantic

parent ce1e61cd
......@@ -100,13 +100,13 @@ set(KOLAB_LINK_LIBRARIES
Qt5::Widgets
)
if(BUILD_TESTS)
if(BUILD_TESTING)
#for tests only
enable_testing()
add_library(kolab_static STATIC ${KOLAB_SRCS})
target_link_libraries(kolab_static ${KOLAB_LINK_LIBRARIES} Qt5::Test)
add_subdirectory(tests)
endif(BUILD_TESTS)
endif()
add_library(pimkolab STATIC ${KOLAB_SRCS})
target_link_libraries(pimkolab ${KOLAB_LINK_LIBRARIES})
......
......@@ -865,7 +865,8 @@ void Incidence::setFields( const KCalCore::Incidence::Ptr &incidence )
// Unhandled tags and other custom properties (see libkcal/customproperties.h)
const QMap<QByteArray, QString> map = incidence->customProperties();
QMap<QByteArray, QString>::ConstIterator cit = map.begin();
for ( ; cit != map.end() ; ++cit ) {
QMap<QByteArray, QString>::ConstIterator cend = map.end();
for ( ; cit != cend ; ++cit ) {
Custom c;
c.key = cit.key();
c.value = cit.value();
......
......@@ -79,6 +79,7 @@ QList<QByteArray> getContentMimeTypeList(const KMime::Message::Ptr& data)
{
QList<QByteArray> typeList;
Q_ASSERT(!data->contents().isEmpty());
typeList.reserve(data->contents().count());
Q_FOREACH(KMime::Content *c, data->contents()) {
typeList.append(c->contentType()->mimeType());
}
......
......@@ -170,7 +170,7 @@ enum TestMode {
ReadOnly,
ReadWrite
};
Q_DECLARE_METATYPE(TestMode);
Q_DECLARE_METATYPE(TestMode)
void FormatTest::testContact_data()
{
......
......@@ -30,20 +30,20 @@
#include <kolabformat.h>
Q_DECLARE_METATYPE(Kolab::Duration);
Q_DECLARE_METATYPE(Kolab::cDateTime);
Q_DECLARE_METATYPE(std::vector<Kolab::cDateTime>);
Q_DECLARE_METATYPE(Kolab::Event);
Q_DECLARE_METATYPE(std::vector<Kolab::Event>);
Q_DECLARE_METATYPE(Kolab::Todo);
Q_DECLARE_METATYPE(Kolab::Journal);
Q_DECLARE_METATYPE(Kolab::Contact);
Q_DECLARE_METATYPE(Kolab::Period);
Q_DECLARE_METATYPE(std::vector<Kolab::FreebusyPeriod>);
Q_DECLARE_METATYPE(Kolab::Duration)
Q_DECLARE_METATYPE(Kolab::cDateTime)
Q_DECLARE_METATYPE(std::vector<Kolab::cDateTime>)
Q_DECLARE_METATYPE(Kolab::Event)
Q_DECLARE_METATYPE(std::vector<Kolab::Event>)
Q_DECLARE_METATYPE(Kolab::Todo)
Q_DECLARE_METATYPE(Kolab::Journal)
Q_DECLARE_METATYPE(Kolab::Contact)
Q_DECLARE_METATYPE(Kolab::Period)
Q_DECLARE_METATYPE(std::vector<Kolab::FreebusyPeriod>)
Q_DECLARE_METATYPE(KCalCore::Event);
Q_DECLARE_METATYPE(KCalCore::Todo);
Q_DECLARE_METATYPE(KCalCore::Journal);
Q_DECLARE_METATYPE(KCalCore::Event)
Q_DECLARE_METATYPE(KCalCore::Todo)
Q_DECLARE_METATYPE(KCalCore::Journal)
namespace QTest {
......
......@@ -27,8 +27,8 @@
#include "kolabformat/kolabobject.h"
Q_DECLARE_METATYPE(Kolab::ObjectType);
Q_DECLARE_METATYPE(Kolab::Version);
Q_DECLARE_METATYPE(Kolab::ObjectType)
Q_DECLARE_METATYPE(Kolab::Version)
#define KCOMPARE(actual, expected) \
do {\
......
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