summaryrefslogtreecommitdiffstats
path: root/tests/testqPrefFacebook.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-23 18:50:08 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-27 12:36:20 -0700
commit711b96a143165bf991c69193c0e65f88155e4ba4 (patch)
tree3e35dac6c9ff589e9e56fdd1fdc415f3be2f4e5d /tests/testqPrefFacebook.cpp
parent4102cc755ff53b4ec811a9cf89156842a20258ac (diff)
downloadsubsurface-711b96a143165bf991c69193c0e65f88155e4ba4.tar.gz
tests: move Facebook test from testpreferences
Remove Facebook test in testpreferences add the same Facebook tests to testqPrefFacebook Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'tests/testqPrefFacebook.cpp')
-rw-r--r--tests/testqPrefFacebook.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/testqPrefFacebook.cpp b/tests/testqPrefFacebook.cpp
index 230197b10..815896cd1 100644
--- a/tests/testqPrefFacebook.cpp
+++ b/tests/testqPrefFacebook.cpp
@@ -57,4 +57,30 @@ void TestQPrefFacebook::test_multiple()
QCOMPARE(tst->access_token(), tst_direct->access_token());
}
+#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"));
+}
+
QTEST_MAIN(TestQPrefFacebook)