diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2012-12-11 11:10:58 +0100 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2012-12-11 13:55:44 +0100 |
commit | 707f1b4419438f803a228707f803f91b417e49b8 (patch) | |
tree | 82a2afa4cd3876680ab446c4aa5fdb0be26f1ddc /tests/manual/ssh | |
parent | 0d3683450f03b0bc11864f86da04c926890ce4ac (diff) | |
download | qt-creator-707f1b4419438f803a228707f803f91b417e49b8.tar.gz |
SSH: Adapt tests to API change.
Change-Id: I0b104942d97238aff8ac21e0e047a17079a53181
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diffstat (limited to 'tests/manual/ssh')
-rw-r--r-- | tests/manual/ssh/remoteprocess/argumentscollector.cpp | 11 | ||||
-rw-r--r-- | tests/manual/ssh/remoteprocess/argumentscollector.h | 4 | ||||
-rw-r--r-- | tests/manual/ssh/sftp/argumentscollector.cpp | 11 | ||||
-rw-r--r-- | tests/manual/ssh/sftp/argumentscollector.h | 2 | ||||
-rw-r--r-- | tests/manual/ssh/tunnel/argumentscollector.cpp | 11 | ||||
-rw-r--r-- | tests/manual/ssh/tunnel/argumentscollector.h | 4 |
6 files changed, 21 insertions, 22 deletions
diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.cpp b/tests/manual/ssh/remoteprocess/argumentscollector.cpp index 6373328c8b..9ff144123e 100644 --- a/tests/manual/ssh/remoteprocess/argumentscollector.cpp +++ b/tests/manual/ssh/remoteprocess/argumentscollector.cpp @@ -45,6 +45,7 @@ ArgumentsCollector::ArgumentsCollector(const QStringList &args) QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const { SshConnectionParameters parameters; + parameters.options &= ~SshIgnoreDefaultProxy; try { bool authTypeGiven = false; bool portGiven = false; @@ -76,13 +77,13 @@ QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const authTypeGiven = true; continue; } - if (!checkForNoProxy(pos, parameters.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } Q_ASSERT(pos <= m_arguments.count()); if (pos == m_arguments.count() - 1) { - if (!checkForNoProxy(pos, parameters.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } @@ -156,13 +157,13 @@ bool ArgumentsCollector::checkAndSetIntArg(int &pos, int &val, return false; } -bool ArgumentsCollector::checkForNoProxy(int &pos, - SshConnectionParameters::ProxyType &type, bool &alreadyGiven) const +bool ArgumentsCollector::checkForNoProxy(int &pos, SshConnectionOptions &options, + bool &alreadyGiven) const { if (m_arguments.at(pos) == QLatin1String("-no-proxy")) { if (alreadyGiven) throw ArgumentErrorException(QLatin1String("proxy setting given twice.")); - type = SshConnectionParameters::NoProxy; + options |= SshIgnoreDefaultProxy; alreadyGiven = true; return true; } diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.h b/tests/manual/ssh/remoteprocess/argumentscollector.h index 679d9970b8..6c65a5b69b 100644 --- a/tests/manual/ssh/remoteprocess/argumentscollector.h +++ b/tests/manual/ssh/remoteprocess/argumentscollector.h @@ -50,9 +50,7 @@ private: bool checkAndSetStringArg(int &pos, QString &arg, const char *opt) const; bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven, const char *opt) const; - bool checkForNoProxy(int &pos, - QSsh::SshConnectionParameters::ProxyType &type, - bool &alreadyGiven) const; + bool checkForNoProxy(int &pos, QSsh::SshConnectionOptions &options, bool &alreadyGiven) const; const QStringList m_arguments; }; diff --git a/tests/manual/ssh/sftp/argumentscollector.cpp b/tests/manual/ssh/sftp/argumentscollector.cpp index c104eb30b4..05345ef691 100644 --- a/tests/manual/ssh/sftp/argumentscollector.cpp +++ b/tests/manual/ssh/sftp/argumentscollector.cpp @@ -43,6 +43,7 @@ ArgumentsCollector::ArgumentsCollector(const QStringList &args) Parameters ArgumentsCollector::collect(bool &success) const { Parameters parameters; + parameters.sshParams.options &= ~SshIgnoreDefaultProxy; try { bool authTypeGiven = false; bool portGiven = false; @@ -77,13 +78,13 @@ Parameters ArgumentsCollector::collect(bool &success) const authTypeGiven = true; continue; } - if (!checkForNoProxy(pos, parameters.sshParams.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.sshParams.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } Q_ASSERT(pos <= m_arguments.count()); if (pos == m_arguments.count() - 1) { - if (!checkForNoProxy(pos, parameters.sshParams.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.sshParams.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } @@ -154,13 +155,13 @@ bool ArgumentsCollector::checkAndSetIntArg(int &pos, int &val, return false; } -bool ArgumentsCollector::checkForNoProxy(int &pos, - SshConnectionParameters::ProxyType &type, bool &alreadyGiven) const +bool ArgumentsCollector::checkForNoProxy(int &pos, SshConnectionOptions &options, + bool &alreadyGiven) const { if (m_arguments.at(pos) == QLatin1String("-no-proxy")) { if (alreadyGiven) throw ArgumentErrorException(QLatin1String("proxy setting given twice.")); - type = SshConnectionParameters::NoProxy; + options |= SshIgnoreDefaultProxy; alreadyGiven = true; return true; } diff --git a/tests/manual/ssh/sftp/argumentscollector.h b/tests/manual/ssh/sftp/argumentscollector.h index 2168211b07..483b24f8ee 100644 --- a/tests/manual/ssh/sftp/argumentscollector.h +++ b/tests/manual/ssh/sftp/argumentscollector.h @@ -50,7 +50,7 @@ private: bool checkAndSetStringArg(int &pos, QString &arg, const char *opt) const; bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven, const char *opt) const; - bool checkForNoProxy(int &pos, QSsh::SshConnectionParameters::ProxyType &type, + bool checkForNoProxy(int &pos, QSsh::SshConnectionOptions &options, bool &alreadyGiven) const; const QStringList m_arguments; diff --git a/tests/manual/ssh/tunnel/argumentscollector.cpp b/tests/manual/ssh/tunnel/argumentscollector.cpp index a533ac966a..28276dfd6b 100644 --- a/tests/manual/ssh/tunnel/argumentscollector.cpp +++ b/tests/manual/ssh/tunnel/argumentscollector.cpp @@ -48,6 +48,7 @@ ArgumentsCollector::ArgumentsCollector(const QStringList &args) QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const { SshConnectionParameters parameters; + parameters.options &= ~SshIgnoreDefaultProxy; parameters.host = QLatin1String("localhost"); try { @@ -80,13 +81,13 @@ QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const authTypeGiven = true; continue; } - if (!checkForNoProxy(pos, parameters.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } Q_ASSERT(pos <= m_arguments.count()); if (pos == m_arguments.count() - 1) { - if (!checkForNoProxy(pos, parameters.proxyType, proxySettingGiven)) + if (!checkForNoProxy(pos, parameters.options, proxySettingGiven)) throw ArgumentErrorException(QLatin1String("unknown option ") + m_arguments.at(pos)); } @@ -160,13 +161,13 @@ bool ArgumentsCollector::checkAndSetIntArg(int &pos, int &val, return false; } -bool ArgumentsCollector::checkForNoProxy(int &pos, - SshConnectionParameters::ProxyType &type, bool &alreadyGiven) const +bool ArgumentsCollector::checkForNoProxy(int &pos, SshConnectionOptions &options, + bool &alreadyGiven) const { if (m_arguments.at(pos) == QLatin1String("-no-proxy")) { if (alreadyGiven) throw ArgumentErrorException(QLatin1String("proxy setting given twice.")); - type = SshConnectionParameters::NoProxy; + options |= SshIgnoreDefaultProxy; alreadyGiven = true; return true; } diff --git a/tests/manual/ssh/tunnel/argumentscollector.h b/tests/manual/ssh/tunnel/argumentscollector.h index d7189597f1..25f4d306ef 100644 --- a/tests/manual/ssh/tunnel/argumentscollector.h +++ b/tests/manual/ssh/tunnel/argumentscollector.h @@ -53,9 +53,7 @@ private: bool checkAndSetStringArg(int &pos, QString &arg, const char *opt) const; bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven, const char *opt) const; - bool checkForNoProxy(int &pos, - QSsh::SshConnectionParameters::ProxyType &type, - bool &alreadyGiven) const; + bool checkForNoProxy(int &pos, QSsh::SshConnectionOptions &options, bool &alreadyGiven) const; const QStringList m_arguments; }; |