summaryrefslogtreecommitdiffstats
path: root/tdeioslave/smtp/test_headergeneration.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-12-07 22:58:44 +0900
committerMichele Calgaro <[email protected]>2020-12-07 23:22:36 +0900
commitad6f3f6402df4bdf88672d511e21ab1e9b88d978 (patch)
treebacd0af440aa1a0671045d431406cda36d4df618 /tdeioslave/smtp/test_headergeneration.cpp
parent6ab96d20b89c0e1d86abc00513c7cec304d85800 (diff)
downloadtdebase-ad6f3f6402df4bdf88672d511e21ab1e9b88d978.tar.gz
tdebase-ad6f3f6402df4bdf88672d511e21ab1e9b88d978.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit 145abc15d57fb29701a12e8a14dcb9c1fd72e9be)
Diffstat (limited to 'tdeioslave/smtp/test_headergeneration.cpp')
-rw-r--r--tdeioslave/smtp/test_headergeneration.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/tdeioslave/smtp/test_headergeneration.cpp b/tdeioslave/smtp/test_headergeneration.cpp
new file mode 100644
index 000000000..9e4cb971f
--- /dev/null
+++ b/tdeioslave/smtp/test_headergeneration.cpp
@@ -0,0 +1,86 @@
+#include "request.h"
+
+//#include <iostream>
+
+//using std::cout;
+//using std::endl;
+
+int main( int , char ** ) {
+ static TQCString expected =
+ "From: [email protected]\r\n"
+ "Subject: missing subject\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: Marc Mutz <[email protected]>\r\n"
+ "Subject: missing subject\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: \"Mutz, Marc\" <[email protected]>\r\n"
+ "Subject: missing subject\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: =?utf-8?b?TWFyYyBNw7Z0eg==?= <[email protected]>\r\n"
+ "Subject: missing subject\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: [email protected]\r\n"
+ "Subject: =?utf-8?b?QmzDtmRlcyBTdWJqZWN0?=\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: Marc Mutz <[email protected]>\r\n"
+ "Subject: =?utf-8?b?QmzDtmRlcyBTdWJqZWN0?=\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: \"Mutz, Marc\" <[email protected]>\r\n"
+ "Subject: =?utf-8?b?QmzDtmRlcyBTdWJqZWN0?=\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n"
+ "From: =?utf-8?b?TWFyYyBNw7Z0eg==?= <[email protected]>\r\n"
+ "Subject: =?utf-8?b?QmzDtmRlcyBTdWJqZWN0?=\r\n"
+ "To: [email protected],\r\n"
+ "Cc: [email protected]\r\n"
+ "\n";
+
+ KioSMTP::Request request;
+ TQCString result;
+
+ request.setEmitHeaders( true );
+ request.setFromAddress( "[email protected]" );
+ request.addTo( "[email protected]" );
+ request.addTo( "[email protected]" );
+ request.addCc( "[email protected]" );
+
+ result += request.headerFields() + '\n';
+ result += request.headerFields( "Marc Mutz" ) + '\n';
+ result += request.headerFields( "Mutz, Marc" ) + '\n';
+ result += request.headerFields( "Marc M�tz" ) + '\n';
+
+ request.setSubject( "Bl�des Subject" );
+
+ result += request.headerFields() + '\n';
+ result += request.headerFields( "Marc Mutz" ) + '\n';
+ result += request.headerFields( "Mutz, Marc" ) + '\n';
+ result += request.headerFields( "Marc M�tz" ) + '\n';
+
+ //cout << "Result:\n" << result.data() << endl;
+
+ return result == expected ? 0 : 1 ;
+}
+
+#include "request.cpp"
+