aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincent-richard <[email protected]>2021-04-03 09:21:50 +0000
committervincent-richard <[email protected]>2021-04-03 09:21:50 +0000
commitc6904bd7cf03f6cca92cf0d15aec02e7850e0276 (patch)
treeefaae1c287753fa0080d65878399b3dc97c4b7b9 /tests
parentMerge pull request #256 from jacadcaps/IMAP.PEEK (diff)
downloadvmime-c6904bd7cf03f6cca92cf0d15aec02e7850e0276.tar.gz
vmime-c6904bd7cf03f6cca92cf0d15aec02e7850e0276.zip
SMTP/DSN refactoring.
Diffstat (limited to 'tests')
-rw-r--r--tests/net/smtp/SMTPCommandTest.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/tests/net/smtp/SMTPCommandTest.cpp b/tests/net/smtp/SMTPCommandTest.cpp
index ecaf292c..f4b6c082 100644
--- a/tests/net/smtp/SMTPCommandTest.cpp
+++ b/tests/net/smtp/SMTPCommandTest.cpp
@@ -24,6 +24,7 @@
#include "tests/testUtils.hpp"
#include "vmime/net/smtp/SMTPCommand.hpp"
+#include "vmime/net/smtp/DSNAttributes.hpp"
using namespace vmime::net::smtp;
@@ -114,7 +115,9 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testMAIL() {
- vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(vmime::mailbox("[email protected]"), false, "FULL", "dsn-unique-id");
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("", "FULL", "dsn-unique-id");
+
+ vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(vmime::mailbox("[email protected]"), false, dsnAttrs);
VASSERT_NOT_NULL("Not null", cmd);
VASSERT_EQ("Text", "MAIL FROM:<[email protected]> RET=FULL ENVID=<dsn-unique-id>", cmd->getText());
@@ -122,8 +125,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testMAIL_Encoded() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("", "FULL", "dsn-unique-id");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(
- vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), false, "FULL", "dsn-unique-id"
+ vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), false, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);
@@ -132,8 +137,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testMAIL_UTF8() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("", "FULL", "dsn-unique-id");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(
- vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, "FULL", "dsn-unique-id"
+ vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);
@@ -142,8 +149,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testMAIL_SIZE() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("", "FULL", "dsn-unique-id");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(
- vmime::mailbox("[email protected]"), false, 123456789, "FULL", "dsn-unique-id"
+ vmime::mailbox("[email protected]"), false, 123456789, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);
@@ -152,8 +161,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testMAIL_SIZE_UTF8() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("", "FULL", "dsn-unique-id");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::MAIL(
- vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, 123456789, "FULL", "dsn-unique-id"
+ vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, 123456789, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);
@@ -162,8 +173,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testRCPT() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("NEVER", "", "");
+
vmime::shared_ptr <SMTPCommand> cmd =
- SMTPCommand::RCPT(vmime::mailbox("[email protected]"), false, "NEVER");
+ SMTPCommand::RCPT(vmime::mailbox("[email protected]"), false, dsnAttrs);
VASSERT_NOT_NULL("Not null", cmd);
VASSERT_EQ("Text", "RCPT TO:<[email protected]> NOTIFY=NEVER", cmd->getText());
@@ -171,8 +184,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testRCPT_Encoded() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("NEVER", "", "");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::RCPT(
- vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), false, "NEVER"
+ vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), false, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);
@@ -181,8 +196,10 @@ VMIME_TEST_SUITE_BEGIN(SMTPCommandTest)
void testRCPT_UTF8() {
+ auto dsnAttrs = vmime::make_shared <DSNAttributes>("NEVER", "", "");
+
vmime::shared_ptr <SMTPCommand> cmd = SMTPCommand::RCPT(
- vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, "NEVER"
+ vmime::mailbox(vmime::emailAddress("mailtest", "例え.テスト")), true, dsnAttrs
);
VASSERT_NOT_NULL("Not null", cmd);