Changeset View
Changeset View
Standalone View
Standalone View
autotests/gravatarresolvurljobtest.cpp
Show All 13 Lines | 1 | /* | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "gravatarresolvurljobtest.h" | 20 | #include "gravatarresolvurljobtest.h" | ||
21 | #include "../src/job/gravatarresolvurljob.h" | 21 | #include "../src/job/gravatarresolvurljob.h" | ||
22 | #include "../src/misc/hash.h" | ||||
22 | #include <qtest.h> | 23 | #include <qtest.h> | ||
23 | 24 | | |||
24 | GravatarResolvUrlJobTest::GravatarResolvUrlJobTest(QObject *parent) | 25 | GravatarResolvUrlJobTest::GravatarResolvUrlJobTest(QObject *parent) | ||
25 | : QObject(parent) | 26 | : QObject(parent) | ||
26 | { | 27 | { | ||
27 | } | 28 | } | ||
28 | 29 | | |||
29 | GravatarResolvUrlJobTest::~GravatarResolvUrlJobTest() | 30 | GravatarResolvUrlJobTest::~GravatarResolvUrlJobTest() | ||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 162 | { | |||
162 | QFETCH(QString, input); | 163 | QFETCH(QString, input); | ||
163 | QFETCH(QString, calculedhash); | 164 | QFETCH(QString, calculedhash); | ||
164 | QFETCH(QUrl, output); | 165 | QFETCH(QUrl, output); | ||
165 | QFETCH(bool, uselibravatar); | 166 | QFETCH(bool, uselibravatar); | ||
166 | Gravatar::GravatarResolvUrlJob job; | 167 | Gravatar::GravatarResolvUrlJob job; | ||
167 | job.setEmail(input); | 168 | job.setEmail(input); | ||
168 | job.setUseLibravatar(uselibravatar); | 169 | job.setUseLibravatar(uselibravatar); | ||
169 | QUrl url = job.generateGravatarUrl(job.useLibravatar()); | 170 | QUrl url = job.generateGravatarUrl(job.useLibravatar()); | ||
170 | QCOMPARE(calculedhash, job.calculatedHash()); | 171 | QCOMPARE(calculedhash, job.calculatedHash().hexString()); | ||
171 | QCOMPARE(url, output); | 172 | QCOMPARE(url, output); | ||
172 | } | 173 | } | ||
173 | 174 | | |||
174 | QTEST_MAIN(GravatarResolvUrlJobTest) | 175 | QTEST_MAIN(GravatarResolvUrlJobTest) |