[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ruqola] /: Start to create an autotest. Clean up code
From:       Montel Laurent <null () kde ! org>
Date:       2017-08-09 5:03:08
Message-ID: E1dfJ9A-0005HN-4o () code ! kde ! org
[Download RAW message or body]

Git commit d350fc8e1785553edf6e0f49988dbd66f5ea63e0 by Montel Laurent.
Committed on 09/08/2017 at 05:02.
Pushed by mlaurent into branch 'master'.

Start to create an autotest. Clean up code

M  +1    -0    autotests/CMakeLists.txt
A  +31   -0    autotests/roommodeltest.cpp     [License: LGPL (v2/3+eV)]
A  +35   -0    autotests/roommodeltest.h     [License: LGPL (v2/3+eV)]
M  +2    -4    src/roommodel.h

https://commits.kde.org/ruqola/d350fc8e1785553edf6e0f49988dbd66f5ea63e0

diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index c2f2b34..dbd03ae 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -9,3 +9,4 @@ macro(add_ruqola_test _source _additionalsource)
 endmacro()
 
 add_ruqola_test(rocketchatmessagetest.cpp "")
+add_ruqola_test(roommodeltest.cpp "")
diff --git a/autotests/roommodeltest.cpp b/autotests/roommodeltest.cpp
new file mode 100644
index 0000000..be068bb
--- /dev/null
+++ b/autotests/roommodeltest.cpp
@@ -0,0 +1,31 @@
+/*
+   Copyright (c) 2017 Montel Laurent <montel@kde.org>
+
+   This library is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2 of the License or
+   ( at your option ) version 3 or, at the discretion of KDE e.V.
+   ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+
+#include "roommodeltest.h"
+#include <QTest>
+
+QTEST_MAIN(RoomModelTest)
+
+RoomModelTest::RoomModelTest(QObject *parent)
+    : QObject(parent)
+{
+
+}
diff --git a/autotests/roommodeltest.h b/autotests/roommodeltest.h
new file mode 100644
index 0000000..bed679b
--- /dev/null
+++ b/autotests/roommodeltest.h
@@ -0,0 +1,35 @@
+/*
+   Copyright (c) 2017 Montel Laurent <montel@kde.org>
+
+   This library is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2 of the License or
+   ( at your option ) version 3 or, at the discretion of KDE e.V.
+   ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef ROOMMODELTEST_H
+#define ROOMMODELTEST_H
+
+#include <QObject>
+
+class RoomModelTest : public QObject
+{
+    Q_OBJECT
+public:
+    explicit RoomModelTest(QObject *parent = nullptr);
+    ~RoomModelTest() = default;
+};
+
+#endif // ROOMMODELTEST_H
diff --git a/src/roommodel.h b/src/roommodel.h
index 1d10d7e..7ae1b9c 100644
--- a/src/roommodel.h
+++ b/src/roommodel.h
@@ -52,8 +52,8 @@ public:
     explicit RoomModel(QObject *parent = nullptr);
     virtual ~RoomModel();
 
-    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
-    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) \
const; +    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const \
override;  
     /**
     * @brief Constructs room object from @param roomID and @param roomName and \
@param selected, then calls @method addRoom @@ -104,9 +104,7 @@ protected:
     QHash<int, QByteArray> roleNames() const override;
 
 private:
-
     QVector<Room> m_roomsList;
-    //QHash< QString, Room > m_roomsHash;
 };
 
 #endif // ROOMMODEL_H


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic