diff options
author | jan Iversen <jani@apache.org> | 2018-07-28 19:03:58 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-30 07:43:22 -0700 |
commit | 7acd489891883c5530d184bc6c6b11dd64b00c34 (patch) | |
tree | 74c8e75952e6969d03af91695071090c63ac9d28 | |
parent | e198230c83b4c3690ee47d47df676b2a6cb157f4 (diff) | |
download | subsurface-7acd489891883c5530d184bc6c6b11dd64b00c34.tar.gz |
tests: move Proxy test from testpreferences
Remove Proxy test in testpreferences
add the same Proxy tests to testqPrefProxy
Signed-off-by: Jan Iversen <jani@apache.org>
-rw-r--r-- | tests/testpreferences.cpp | 29 | ||||
-rw-r--r-- | tests/testqPrefProxy.cpp | 39 | ||||
-rw-r--r-- | tests/testqPrefProxy.h | 1 |
3 files changed, 40 insertions, 29 deletions
diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp index c82159652..185d52a9b 100644 --- a/tests/testpreferences.cpp +++ b/tests/testpreferences.cpp @@ -177,35 +177,6 @@ void TestPreferences::testPreferences() TEST(geo->secondTaxonomyCategory(), TC_COUNTRY); TEST(geo->thirdTaxonomyCategory(), TC_NONE); - auto proxy = qPrefProxy::instance(); - proxy->set_proxy_type(2); - proxy->set_proxy_port(80); - proxy->set_proxy_auth(true); - proxy->set_proxy_host("localhost"); - proxy->set_proxy_user("unknown"); - proxy->set_proxy_pass("secret"); - - TEST(proxy->proxy_type(), 2); - TEST(proxy->proxy_port(), 80); - TEST(proxy->proxy_auth(), true); - TEST(proxy->proxy_host(), QStringLiteral("localhost")); - TEST(proxy->proxy_user(), QStringLiteral("unknown")); - TEST(proxy->proxy_pass(), QStringLiteral("secret")); - - proxy->set_proxy_type(3); - proxy->set_proxy_port(8080); - proxy->set_proxy_auth(false); - proxy->set_proxy_host("127.0.0.1"); - proxy->set_proxy_user("unknown_1"); - proxy->set_proxy_pass("secret_1"); - - TEST(proxy->proxy_type(), 3); - TEST(proxy->proxy_port(), 8080); - TEST(proxy->proxy_auth(), false); - TEST(proxy->proxy_host(), QStringLiteral("127.0.0.1")); - TEST(proxy->proxy_user(), QStringLiteral("unknown_1")); - TEST(proxy->proxy_pass(), QStringLiteral("secret_1")); - auto planner = pref->planner_settings; planner->setLastStop(true); planner->setVerbatimPlan(true); diff --git a/tests/testqPrefProxy.cpp b/tests/testqPrefProxy.cpp index 4db48baf0..921565d2f 100644 --- a/tests/testqPrefProxy.cpp +++ b/tests/testqPrefProxy.cpp @@ -132,4 +132,43 @@ void TestQPrefProxy::test_multiple() QCOMPARE(tst->proxy_type(), 25); } +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + proxy->sync(); \ + proxy->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefProxy::test_oldPreferences() +{ + auto proxy = qPrefProxy::instance(); + + proxy->set_proxy_type(2); + proxy->set_proxy_port(80); + proxy->set_proxy_auth(true); + proxy->set_proxy_host("localhost"); + proxy->set_proxy_user("unknown"); + proxy->set_proxy_pass("secret"); + + TEST(proxy->proxy_type(), 2); + TEST(proxy->proxy_port(), 80); + TEST(proxy->proxy_auth(), true); + TEST(proxy->proxy_host(), QStringLiteral("localhost")); + TEST(proxy->proxy_user(), QStringLiteral("unknown")); + TEST(proxy->proxy_pass(), QStringLiteral("secret")); + + proxy->set_proxy_type(3); + proxy->set_proxy_port(8080); + proxy->set_proxy_auth(false); + proxy->set_proxy_host("127.0.0.1"); + proxy->set_proxy_user("unknown_1"); + proxy->set_proxy_pass("secret_1"); + + TEST(proxy->proxy_type(), 3); + TEST(proxy->proxy_port(), 8080); + TEST(proxy->proxy_auth(), false); + TEST(proxy->proxy_host(), QStringLiteral("127.0.0.1")); + TEST(proxy->proxy_user(), QStringLiteral("unknown_1")); + TEST(proxy->proxy_pass(), QStringLiteral("secret_1")); +} + QTEST_MAIN(TestQPrefProxy) diff --git a/tests/testqPrefProxy.h b/tests/testqPrefProxy.h index 27c0312f9..e47300be2 100644 --- a/tests/testqPrefProxy.h +++ b/tests/testqPrefProxy.h @@ -14,6 +14,7 @@ private slots: void test_set_load_struct(); void test_struct_disk(); void test_multiple(); + void test_oldPreferences(); }; #endif // TESTQPREFPROXY_H |