Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Pim Libraries
Commits
93cbe318
Commit
93cbe318
authored
Dec 09, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add query test
parent
1a93f575
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
kioslave/smtp/tests/requesttest.cpp
kioslave/smtp/tests/requesttest.cpp
+34
-1
kioslave/smtp/tests/requesttest.h
kioslave/smtp/tests/requesttest.h
+2
-0
No files found.
kioslave/smtp/tests/requesttest.cpp
View file @
93cbe318
...
...
@@ -17,7 +17,7 @@
#include "requesttest.h"
#include "../request.h"
#include <qtest_kde.h>
#include <KUrl>
RequestTest
::
RequestTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
...
...
@@ -43,4 +43,37 @@ void RequestTest::shouldHaveDefaultValue()
QCOMPARE
(
request
.
size
(),
static_cast
<
unsigned
int
>
(
0
));
}
void
RequestTest
::
shouldParseRequest_data
()
{
QTest
::
addColumn
<
KUrl
>
(
"smtpurl"
);
QTest
::
addColumn
<
QString
>
(
"to"
);
QTest
::
addColumn
<
QString
>
(
"from"
);
QTest
::
addColumn
<
QString
>
(
"cc"
);
QTest
::
addColumn
<
QString
>
(
"bcc"
);
QTest
::
addColumn
<
unsigned
int
>
(
"size"
);
QTest
::
newRow
(
"correct url"
)
<<
KUrl
(
QLatin1String
(
"smtps://smtp.kde.org:465/send?headers=0&from=foo%40kde.org&to=foo%40kde.org&size=617"
))
<<
QString
(
QLatin1String
(
"foo@kde.org"
))
<<
QString
(
QLatin1String
(
"foo@kde.org"
))
<<
QString
()
<<
QString
()
<<
static_cast
<
unsigned
int
>
(
617
);
}
void
RequestTest
::
shouldParseRequest
()
{
QFETCH
(
KUrl
,
smtpurl
);
QFETCH
(
QString
,
to
);
QFETCH
(
QString
,
from
);
QFETCH
(
QString
,
cc
);
QFETCH
(
QString
,
bcc
);
QFETCH
(
unsigned
int
,
size
);
KioSMTP
::
Request
request
=
KioSMTP
::
Request
::
fromURL
(
smtpurl
);
QCOMPARE
(
request
.
to
().
join
(
QLatin1String
(
","
)),
to
);
QCOMPARE
(
request
.
cc
().
join
(
QLatin1String
(
","
)),
cc
);
QCOMPARE
(
request
.
fromAddress
(),
from
);
QCOMPARE
(
request
.
bcc
().
join
(
QLatin1String
(
","
)),
bcc
);
QCOMPARE
(
request
.
size
(),
size
);
}
QTEST_KDEMAIN
(
RequestTest
,
NoGUI
)
kioslave/smtp/tests/requesttest.h
View file @
93cbe318
...
...
@@ -28,6 +28,8 @@ public:
~
RequestTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
void
shouldParseRequest_data
();
void
shouldParseRequest
();
};
#endif // REQUESTTEST_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment