/* SPDX-FileCopyrightText: 2012-2013 Jan Grulich SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #include "pppsettingtest.h" #include "settings/pppsetting.h" #include #include void PppSettingTest::testSetting_data() { QTest::addColumn("noAuth"); QTest::addColumn("refuseEap"); QTest::addColumn("refusePap"); QTest::addColumn("refuseChap"); QTest::addColumn("refuseMschap"); QTest::addColumn("refuseMschapv2"); QTest::addColumn("noBsdComp"); QTest::addColumn("noDeflate"); QTest::addColumn("noVjCompare"); QTest::addColumn("requireMppe"); QTest::addColumn("requireMppe128"); QTest::addColumn("mppeStateful"); QTest::addColumn("cRtsCts"); QTest::addColumn("baud"); QTest::addColumn("mru"); QTest::addColumn("mtu"); QTest::addColumn("lcpEchoFailure"); QTest::addColumn("lcpEchoInterval"); QTest::newRow("setting1") << false // noAuth << true // refuseEap << true // refusePap << true // refuseChap << true // refuseMschap << true // refuseMschapv2 << true // noBsdComp << true // noDeflate << true // noVjCompare << true // requireMppe << true // requireMppe128 << true // mppeStateful << true // cRtsCts << (quint32)1000 // baud << (quint32)128 // mru << (quint32)500 // mtu << (quint32)2 // lcpEchoFailure << (quint32)3; // lcpEchoInterval } void PppSettingTest::testSetting() { QFETCH(bool, noAuth); QFETCH(bool, refuseEap); QFETCH(bool, refusePap); QFETCH(bool, refuseChap); QFETCH(bool, refuseMschap); QFETCH(bool, refuseMschapv2); QFETCH(bool, noBsdComp); QFETCH(bool, noDeflate); QFETCH(bool, noVjCompare); QFETCH(bool, requireMppe); QFETCH(bool, requireMppe128); QFETCH(bool, mppeStateful); QFETCH(bool, cRtsCts); QFETCH(quint32, baud); QFETCH(quint32, mru); QFETCH(quint32, mtu); QFETCH(quint32, lcpEchoFailure); QFETCH(quint32, lcpEchoInterval); QVariantMap map; map.insert(QLatin1String(NM_SETTING_PPP_NOAUTH), noAuth); map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_EAP), refuseEap); map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_PAP), refusePap); map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_CHAP), refuseChap); map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP), refuseMschap); map.insert(QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2), refuseMschapv2); map.insert(QLatin1String(NM_SETTING_PPP_NOBSDCOMP), noBsdComp); map.insert(QLatin1String(NM_SETTING_PPP_NODEFLATE), noDeflate); map.insert(QLatin1String(NM_SETTING_PPP_NO_VJ_COMP), noVjCompare); map.insert(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE), requireMppe); map.insert(QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128), requireMppe128); map.insert(QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL), mppeStateful); map.insert(QLatin1String(NM_SETTING_PPP_CRTSCTS), cRtsCts); map.insert(QLatin1String(NM_SETTING_PPP_BAUD), baud); map.insert(QLatin1String(NM_SETTING_PPP_MRU), mru); map.insert(QLatin1String(NM_SETTING_PPP_MTU), mtu); map.insert(QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE), lcpEchoFailure); map.insert(QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL), lcpEchoInterval); NetworkManager::PppSetting setting; setting.fromMap(map); QVariantMap map1 = setting.toMap(); QVariantMap::const_iterator it = map.constBegin(); while (it != map.constEnd()) { QCOMPARE(it.value(), map1.value(it.key())); ++it; } } QTEST_MAIN(PppSettingTest) #include "moc_pppsettingtest.cpp"