diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2019-02-01 04:11:25 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-02-01 17:16:43 -0800 |
commit | a1ffe115cfb27bd0dd57bf5266c7d37d9ce64dab (patch) | |
tree | 6589e06ecce1d0c461900fd2537bf5125afadf9d /tests | |
parent | 0c07b02974a65608d7d71ef150d322678ec1170b (diff) | |
download | subsurface-a1ffe115cfb27bd0dd57bf5266c7d37d9ce64dab.tar.gz |
facebook: remove the featute from the code base
Remove from:
- unit tests
- desktop widgets
- preferences
- core intergration
- cmakefiles
- build scripts
- icons
- docs
Also remove the plugins and social network integration.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/testqPrefFacebook.cpp | 109 | ||||
-rw-r--r-- | tests/testqPrefFacebook.h | 20 | ||||
-rw-r--r-- | tests/tst_qPrefFacebook.qml | 46 |
4 files changed, 0 insertions, 177 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd827cea5..c90453954 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -108,7 +108,6 @@ TEST(TestQPrefCloudStorage testqPrefCloudStorage.cpp) TEST(TestQPrefDisplay testqPrefDisplay.cpp) TEST(TestQPrefDiveComputer testqPrefDiveComputer.cpp) TEST(TestQPrefDivePlanner testqPrefDivePlanner.cpp) -TEST(TestQPrefFacebook testqPrefFacebook.cpp) TEST(TestQPrefGeneral testqPrefGeneral.cpp) TEST(TestQPrefGeocoding testqPrefGeocoding.cpp) TEST(TestQPrefLanguage testqPrefLanguage.cpp) @@ -139,7 +138,6 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} TestQPrefDisplay TestQPrefDiveComputer TestQPrefDivePlanner - TestQPrefFacebook TestQPrefGeneral TestQPrefGeocoding TestQPrefLanguage diff --git a/tests/testqPrefFacebook.cpp b/tests/testqPrefFacebook.cpp deleted file mode 100644 index 59063b7a3..000000000 --- a/tests/testqPrefFacebook.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "testqPrefFacebook.h" - -#include "core/settings/qPrefFacebook.h" -#include "core/pref.h" -#include "core/qthelper.h" - -#include <QTest> -#include <QSignalSpy> - -void TestQPrefFacebook::initTestCase() -{ - QCoreApplication::setOrganizationName("Subsurface"); - QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); - QCoreApplication::setApplicationName("SubsurfaceTestQPrefFacebook"); -} - -void TestQPrefFacebook::test_struct_get() -{ - // Test struct pref -> get func. - - auto tst = qPrefFacebook::instance(); - - prefs.facebook.access_token = copy_qstring("t1 token"); - prefs.facebook.album_id = copy_qstring("t1 album"); - prefs.facebook.user_id = copy_qstring("t1 user"); - - QCOMPARE(tst->access_token(), QString(prefs.facebook.access_token)); - QCOMPARE(tst->album_id(), QString(prefs.facebook.album_id)); - QCOMPARE(tst->user_id(), QString(prefs.facebook.user_id)); -} - -void TestQPrefFacebook::test_set_struct() -{ - // Test set func -> struct pref - - auto tst = qPrefFacebook::instance(); - - tst->set_access_token("t2 token"); - tst->set_album_id("t2 album"); - tst->set_user_id("t2 user"); - - QCOMPARE(QString(prefs.facebook.access_token), QString("t2 token")); - QCOMPARE(QString(prefs.facebook.album_id), QString("t2 album")); - QCOMPARE(QString(prefs.facebook.user_id), QString("t2 user")); -} - -void TestQPrefFacebook::test_multiple() -{ - // test multiple instances have the same information - - auto tst_direct = new qPrefFacebook; - prefs.facebook.access_token = copy_qstring("test 1"); - - auto tst = qPrefFacebook::instance(); - prefs.facebook.album_id = copy_qstring("test 2"); - - QCOMPARE(tst->access_token(), tst_direct->access_token()); - QCOMPARE(tst->access_token(), QString("test 1")); - QCOMPARE(tst->album_id(), tst_direct->album_id()); - QCOMPARE(tst->album_id(), QString("test 2")); -} - -#define TEST(METHOD, VALUE) \ -QCOMPARE(METHOD, VALUE); \ -fb->sync(); \ -fb->load(); \ -QCOMPARE(METHOD, VALUE); - -void TestQPrefFacebook::test_oldPreferences() -{ - auto fb = qPrefFacebook::instance(); - fb->set_access_token("rand-access-token"); - fb->set_user_id("tomaz-user-id"); - fb->set_album_id("album-id"); - - TEST(fb->access_token(),QStringLiteral("rand-access-token")); - TEST(fb->user_id(), QStringLiteral("tomaz-user-id")); - TEST(fb->album_id(), QStringLiteral("album-id")); - - fb->set_access_token("rand-access-token-2"); - fb->set_user_id("tomaz-user-id-2"); - fb->set_album_id("album-id-2"); - - TEST(fb->access_token(),QStringLiteral("rand-access-token-2")); - TEST(fb->user_id(), QStringLiteral("tomaz-user-id-2")); - TEST(fb->album_id(), QStringLiteral("album-id-2")); -} - -void TestQPrefFacebook::test_signals() -{ - QSignalSpy spy1(qPrefFacebook::instance(), SIGNAL(access_tokenChanged(QString))); - QSignalSpy spy2(qPrefFacebook::instance(), SIGNAL(album_idChanged(QString))); - QSignalSpy spy3(qPrefFacebook::instance(), SIGNAL(user_idChanged(QString))); - - qPrefFacebook::set_access_token("t_signal token"); - qPrefFacebook::set_album_id("t_signal album"); - qPrefFacebook::set_user_id("t_signal user"); - - QCOMPARE(spy1.count(), 1); - QCOMPARE(spy2.count(), 1); - QCOMPARE(spy3.count(), 1); - QVERIFY(spy1.takeFirst().at(0).toString() == "t_signal token"); - QVERIFY(spy2.takeFirst().at(0).toString() == "t_signal album"); - QVERIFY(spy3.takeFirst().at(0).toString() == "t_signal user"); -} - - -QTEST_MAIN(TestQPrefFacebook) diff --git a/tests/testqPrefFacebook.h b/tests/testqPrefFacebook.h deleted file mode 100644 index bf17a6576..000000000 --- a/tests/testqPrefFacebook.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef TESTQPREFFACEBOOK_H -#define TESTQPREFFACEBOOK_H - -#include <QObject> - -class TestQPrefFacebook : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - void test_struct_get(); - void test_set_struct(); - void test_multiple(); - void test_oldPreferences(); - void test_signals(); -}; - -#endif // TESTQPREFFACEBOOK_H diff --git a/tests/tst_qPrefFacebook.qml b/tests/tst_qPrefFacebook.qml deleted file mode 100644 index 24be306a7..000000000 --- a/tests/tst_qPrefFacebook.qml +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -import QtQuick 2.6 -import QtTest 1.2 - -TestCase { - name: "qPrefFacebook" - - function test_variables() { - var x1 = PrefFacebook.access_token - PrefFacebook.access_token = "my token" - compare(PrefFacebook.access_token, "my token") - - var x2 = PrefFacebook.album_id - PrefFacebook.album_id = "my album" - compare(PrefFacebook.album_id, "my album") - - var x3 = PrefFacebook.user_id - PrefFacebook.user_id = "my user" - compare(PrefFacebook.user_id, "my user") - } - - Item { - id: spyCatcher - - property bool spy1 : false - property bool spy2 : false - property bool spy3 : false - - Connections { - target: PrefFacebook - onAccess_tokenChanged: {spyCatcher.spy1 = true } - onAlbum_idChanged: {spyCatcher.spy2 = true } - onUser_idChanged: {spyCatcher.spy3 = true } - } - } - - function test_signals() { - PrefFacebook.access_token = "qml" - PrefFacebook.album_id = "qml" - PrefFacebook.user_id = "qml" - - compare(spyCatcher.spy1, true) - compare(spyCatcher.spy2, true) - compare(spyCatcher.spy3, true) - } -} |