? addresses = test.get_recipients();
@@ -195,14 +196,14 @@ This is the second line.
assert_addresses_list(addresses, verify_list, "get_recipients");
}
- public void get_searchable_body() throws Error {
+ public void get_searchable_body() throws GLib.Error {
Message test = resource_to_message(BASIC_TEXT_HTML);
string searchable = test.get_searchable_body();
assert_true(searchable.contains("This is the first line"), "Expected body text");
assert_false(searchable.contains(""), "Expected html removed");
}
- public void get_searchable_recipients() throws Error {
+ public void get_searchable_recipients() throws GLib.Error {
Message test = string_to_message(SIMPLE_MULTIRECIPIENT_TO_CC_BCC);
string searchable = test.get_searchable_recipients();
assert_true(searchable.contains("Jane Doe "), "Expected to address");
@@ -210,13 +211,13 @@ This is the second line.
assert_true(searchable.contains("Jane Doe BCC "), "Expected bcc address");
}
- public void get_network_buffer() throws Error {
+ public void get_rfc822_buffer() throws GLib.Error {
Message test = resource_to_message(BASIC_TEXT_PLAIN);
- Memory.Buffer buffer = test.get_network_buffer(true);
+ Memory.Buffer buffer = test.get_rfc822_buffer(NONE);
assert_true(buffer.to_string() == NETWORK_BUFFER_EXPECTED, "Network buffer differs");
}
- public void get_network_buffer_dot_stuff() throws GLib.Error {
+ public void get_rfc822_buffer_dot_stuff() throws GLib.Error {
RFC822.MailboxAddress to = new RFC822.MailboxAddress(
"Test", "test@example.com"
);
@@ -235,11 +236,42 @@ This is the second line.
);
Geary.RFC822.Message message = message_from_composed_email.end(async_result());
- string message_data = message.get_network_buffer(true).to_string();
+ string message_data = message.get_rfc822_buffer(SMTP_FORMAT).to_string();
assert_true(message_data.has_suffix("..newline\r\n..\r\n"));
}
- public void get_network_buffer_long_ascii_line() throws GLib.Error {
+ public void get_rfc822_buffer_no_bcc() throws GLib.Error {
+ RFC822.MailboxAddress to = new RFC822.MailboxAddress(
+ "Test", "test@example.com"
+ );
+ RFC822.MailboxAddress bcc = new RFC822.MailboxAddress(
+ "BCC", "bcc@example.com"
+ );
+ RFC822.MailboxAddress from = new RFC822.MailboxAddress(
+ "Sender", "sender@example.com"
+ );
+ Geary.ComposedEmail composed = new Geary.ComposedEmail(
+ new GLib.DateTime.now_local(),
+ new Geary.RFC822.MailboxAddresses.single(from)
+ ).set_to(
+ new Geary.RFC822.MailboxAddresses.single(to)
+ ).set_bcc(
+ new Geary.RFC822.MailboxAddresses.single(bcc)
+ );
+ composed.body_text = "\nbody\n";
+
+ this.message_from_composed_email.begin(
+ composed,
+ this.async_completion
+ );
+ Geary.RFC822.Message message = message_from_composed_email.end(async_result());
+
+ string message_data = message.get_rfc822_buffer(SMTP_FORMAT).to_string();
+ assert_true("To: Test \r\n" in message_data);
+ assert_false("bcc" in message_data.down());
+ }
+
+ public void get_rfc822_buffer_long_ascii_line() throws GLib.Error {
RFC822.MailboxAddress to = new RFC822.MailboxAddress(
"Test", "test@example.com"
);
@@ -265,7 +297,7 @@ This is the second line.
);
Geary.RFC822.Message message = message_from_composed_email.end(async_result());
- string message_data = message.get_network_buffer(true).to_string();
+ string message_data = message.get_rfc822_buffer(SMTP_FORMAT).to_string();
foreach (var line in message_data.split("\n")) {
assert_true(line.length < 1000, line);
}
@@ -318,7 +350,7 @@ This is the second line.
);
}
- public void from_composed_email_inline_attachments() throws Error {
+ public void from_composed_email_inline_attachments() throws GLib.Error {
RFC822.MailboxAddress to = new RFC822.MailboxAddress(
"Test", "test@example.com"
);
@@ -371,7 +403,8 @@ This is the second line.
assert_true(out_buffer.size > (buffer.size+buffer2.size), "Expected sizeable message");
}
- private async Geary.RFC822.Message message_from_composed_email(Geary.ComposedEmail composed) {
+ private async Message message_from_composed_email(ComposedEmail composed)
+ throws GLib.Error {
return yield new Geary.RFC822.Message.from_composed_email(
composed,
GMime.utils_generate_message_id(composed.from.get(0).domain),
@@ -379,7 +412,7 @@ This is the second line.
);
}
- private Message resource_to_message(string path) throws Error {
+ private Message resource_to_message(string path) throws GLib.Error {
GLib.File resource =
GLib.File.new_for_uri(RESOURCE_URI).resolve_relative_path(path);
@@ -391,7 +424,7 @@ This is the second line.
);
}
- private Message string_to_message(string message_text) throws Error {
+ private Message string_to_message(string message_text) throws GLib.Error {
return new Message.from_buffer(
new Geary.Memory.StringBuffer(message_text)
);
@@ -399,21 +432,21 @@ This is the second line.
private void assert_data(Geary.MessageData.AbstractMessageData? actual,
string expected)
- throws Error {
+ throws GLib.Error {
assert_non_null(actual, expected);
assert_string(expected, actual.to_string());
}
private void assert_address(Geary.RFC822.MailboxAddress? address,
string expected)
- throws Error {
+ throws GLib.Error {
assert_non_null(address, expected);
assert_string(expected, address.to_rfc822_string());
}
private void assert_addresses(Geary.RFC822.MailboxAddresses? addresses,
string expected)
- throws Error {
+ throws GLib.Error {
assert_non_null(addresses, expected);
assert_string(expected, addresses.to_rfc822_string());
}
@@ -421,7 +454,7 @@ This is the second line.
private void assert_addresses_list(Gee.List? addresses,
Gee.List expected,
string context)
- throws Error {
+ throws GLib.Error {
assert_non_null(addresses, context + " not null");
assert_true(addresses.size == expected.size, context + " size");
foreach (RFC822.MailboxAddress address in addresses) {
@@ -431,9 +464,9 @@ This is the second line.
private void assert_message_id_list(Geary.RFC822.MessageIDList? ids,
string expected)
- throws Error {
- assert_non_null(ids, expected);
- assert(ids.to_rfc822_string() == expected);
+ throws GLib.Error {
+ assert_non_null(ids, "ids are null");
+ assert_string(expected, ids.to_rfc822_string());
}
// Courtesy Mailsploit https://www.mailsploit.com
diff --git a/test/engine/rfc822-part-test.vala b/test/engine/rfc822/rfc822-part-test.vala
similarity index 92%
rename from test/engine/rfc822-part-test.vala
rename to test/engine/rfc822/rfc822-part-test.vala
index 9ec2cabf..933d1505 100644
--- a/test/engine/rfc822-part-test.vala
+++ b/test/engine/rfc822/rfc822-part-test.vala
@@ -23,7 +23,7 @@ class Geary.RFC822.PartTest : TestCase {
add_test("write_to_buffer_plain_utf8", write_to_buffer_plain_utf8);
}
- public void new_from_minimal_mime_part() throws Error {
+ public void new_from_minimal_mime_part() throws GLib.Error {
Part test = new Part(new_part("test/plain", CR_BODY.data));
assert_null_string(test.content_id, "content_id");
@@ -31,7 +31,7 @@ class Geary.RFC822.PartTest : TestCase {
assert_null(test.content_disposition, "content_disposition");
}
- public void new_from_complete_mime_part() throws Error {
+ public void new_from_complete_mime_part() throws GLib.Error {
const string TYPE = "text/plain";
const string ID = "test-id";
const string DESC = "test description";
@@ -58,7 +58,7 @@ class Geary.RFC822.PartTest : TestCase {
);
}
- public void write_to_buffer_plain() throws Error {
+ public void write_to_buffer_plain() throws GLib.Error {
Part test = new Part(new_part("text/plain", CR_BODY.data));
Memory.Buffer buf = test.write_to_buffer(Part.EncodingConversion.NONE);
@@ -66,7 +66,7 @@ class Geary.RFC822.PartTest : TestCase {
assert_string(CR_BODY, buf.to_string());
}
- public void write_to_buffer_plain_crlf() throws Error {
+ public void write_to_buffer_plain_crlf() throws GLib.Error {
Part test = new Part(new_part("text/plain", CRLF_BODY.data));
Memory.Buffer buf = test.write_to_buffer(Part.EncodingConversion.NONE);
@@ -75,7 +75,7 @@ class Geary.RFC822.PartTest : TestCase {
assert_string(CR_BODY, buf.to_string());
}
- public void write_to_buffer_plain_ical() throws Error {
+ public void write_to_buffer_plain_ical() throws GLib.Error {
Part test = new Part(new_part("text/calendar", ICAL_BODY.data));
Memory.Buffer buf = test.write_to_buffer(Part.EncodingConversion.NONE);
diff --git a/test/engine/rfc822-utils-test.vala b/test/engine/rfc822/rfc822-utils-test.vala
similarity index 98%
rename from test/engine/rfc822-utils-test.vala
rename to test/engine/rfc822/rfc822-utils-test.vala
index 1691fa41..7711fa9a 100644
--- a/test/engine/rfc822-utils-test.vala
+++ b/test/engine/rfc822/rfc822-utils-test.vala
@@ -15,7 +15,7 @@ class Geary.RFC822.Utils.Test : TestCase {
add_test("best_encoding_binary", best_encoding_binary);
}
- public void to_preview_text() throws Error {
+ public void to_preview_text() throws GLib.Error {
assert(Geary.RFC822.Utils.to_preview_text(PLAIN_BODY_ENCODED, Geary.RFC822.TextFormat.PLAIN) ==
PLAIN_BODY_EXPECTED);
assert(Geary.RFC822.Utils.to_preview_text(HTML_BODY_ENCODED, Geary.RFC822.TextFormat.HTML) ==
diff --git a/test/integration/smtp/client-session.vala b/test/integration/smtp/client-session.vala
index b6c0c801..3d81a5db 100644
--- a/test/integration/smtp/client-session.vala
+++ b/test/integration/smtp/client-session.vala
@@ -118,7 +118,8 @@ class Integration.Smtp.ClientSession : TestCase {
}
private async Geary.RFC822.Message new_message(Geary.RFC822.MailboxAddress from,
- Geary.RFC822.MailboxAddress to) {
+ Geary.RFC822.MailboxAddress to)
+ throws Geary.RFC822.Error {
Geary.ComposedEmail composed = new Geary.ComposedEmail(
new GLib.DateTime.now_local(),
new Geary.RFC822.MailboxAddresses.single(from)
diff --git a/test/meson.build b/test/meson.build
index 9cd4717f..57f33a86 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -52,14 +52,14 @@ geary_test_engine_sources = [
'engine/imap-db/imap-db-folder-test.vala',
'engine/imap-engine/account-processor-test.vala',
'engine/imap-engine/imap-engine-generic-account-test.vala',
- 'engine/mime-content-type-test.vala',
+ 'engine/mime/mime-content-type-test.vala',
'engine/outbox/outbox-email-identifier-test.vala',
- 'engine/rfc822-mailbox-address-test.vala',
- 'engine/rfc822-mailbox-addresses-test.vala',
- 'engine/rfc822-message-test.vala',
- 'engine/rfc822-message-data-test.vala',
- 'engine/rfc822-part-test.vala',
- 'engine/rfc822-utils-test.vala',
+ 'engine/rfc822/rfc822-mailbox-address-test.vala',
+ 'engine/rfc822/rfc822-mailbox-addresses-test.vala',
+ 'engine/rfc822/rfc822-message-test.vala',
+ 'engine/rfc822/rfc822-message-data-test.vala',
+ 'engine/rfc822/rfc822-part-test.vala',
+ 'engine/rfc822/rfc822-utils-test.vala',
'engine/util-ascii-test.vala',
'engine/util-config-file-test.vala',
'engine/util-html-test.vala',
diff --git a/test/test-engine.vala b/test/test-engine.vala
index 2edf95c6..9f88b85a 100644
--- a/test/test-engine.vala
+++ b/test/test-engine.vala
@@ -83,10 +83,12 @@ int main(string[] args) {
engine.add_suite(new Geary.Outbox.EmailIdentifierTest().get_suite());
engine.add_suite(new Geary.RFC822.MailboxAddressTest().get_suite());
engine.add_suite(new Geary.RFC822.MailboxAddressesTest().get_suite());
- engine.add_suite(new Geary.RFC822.MessageTest().get_suite());
engine.add_suite(new Geary.RFC822.MessageDataTest().get_suite());
engine.add_suite(new Geary.RFC822.PartTest().get_suite());
engine.add_suite(new Geary.RFC822.Utils.Test().get_suite());
+ // Message requires all of the rest of the package working, so put
+ // last
+ engine.add_suite(new Geary.RFC822.MessageTest().get_suite());
engine.add_suite(new Geary.String.Test().get_suite());
engine.add_suite(new Geary.ComposedEmailTest().get_suite());
diff --git a/test/test-server.vala b/test/test-server.vala
index 39e99e70..b0894688 100644
--- a/test/test-server.vala
+++ b/test/test-server.vala
@@ -132,6 +132,10 @@ public class TestServer : GLib.Object {
foreach (var line in this.script) {
result.line = line;
switch (line.action) {
+ case CONNECTED:
+ // no-op
+ break;
+
case SEND_LINE:
debug("Sending: %s", line.value);
try {
diff --git a/ui/gtk/help-overlay.ui b/ui/gtk/help-overlay.ui
index d73f2c3a..c0c66461 100644
--- a/ui/gtk/help-overlay.ui
+++ b/ui/gtk/help-overlay.ui
@@ -251,11 +251,23 @@
+
+
+
+