diff options
Diffstat (limited to 'src/plugins/android/androidsdkmanager.cpp')
| -rw-r--r-- | src/plugins/android/androidsdkmanager.cpp | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index bdb3378c0b..4494f4837f 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -20,18 +20,13 @@ #include <QSettings> #include <QTextCodec> -#ifdef WITH_TESTS -# include <QTest> -# include "androidplugin.h" -#endif // WITH_TESTS - -using namespace Utils; - namespace { Q_LOGGING_CATEGORY(sdkManagerLog, "qtc.android.sdkManager", QtWarningMsg) const char commonArgsKey[] = "Common Arguments:"; } +using namespace Utils; + namespace Android { namespace Internal { @@ -652,54 +647,5 @@ void AndroidSdkManagerPrivate::clearPackages() m_allPackages.clear(); } -#ifdef WITH_TESTS -void AndroidPlugin::testAndroidSdkManagerProgressParser_data() -{ - QTest::addColumn<QString>("output"); - QTest::addColumn<int>("progress"); - QTest::addColumn<bool>("foundAssertion"); - - // Output of "sdkmanager --licenses", Android SDK Tools version 4.0 - QTest::newRow("Loading local repository") - << "Loading local repository... \r" - << -1 - << false; - - QTest::newRow("Fetch progress (single line)") - << "[============= ] 34% Fetch remote repository... \r" - << 34 - << false; - - QTest::newRow("Fetch progress (multi line)") - << "[============================= ] 73% Fetch remote repository... \r" - "[============================= ] 75% Fetch remote repository... \r" - << 75 - << false; - - QTest::newRow("Some SDK package licenses not accepted") - << "7 of 7 SDK package licenses not accepted.\n" - << -1 - << false; - - QTest::newRow("Unaccepted licenses assertion") - << "\nReview licenses that have not been accepted (y/N)? " - << -1 - << true; -} - -void AndroidPlugin::testAndroidSdkManagerProgressParser() -{ - QFETCH(QString, output); - QFETCH(int, progress); - QFETCH(bool, foundAssertion); - - bool actualFoundAssertion = false; - const int actualProgress = parseProgress(output, actualFoundAssertion); - - QCOMPARE(progress, actualProgress); - QCOMPARE(foundAssertion, actualFoundAssertion); -} -#endif // WITH_TESTS - } // namespace Internal } // namespace Android |
