[geary/wip/794174-conversation-monitor-max-cpu: 1/4] Allow test fixtures and test methods to throw errors by default.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/794174-conversation-monitor-max-cpu: 1/4] Allow test fixtures and test methods to throw errors by default.
- Date: Sat, 24 Mar 2018 03:15:18 +0000 (UTC)
commit d76cf9d4d3ec4699738b3049165cd277a8fe9c23
Author: Michael James Gratton <mike vee net>
Date: Wed Mar 7 17:30:14 2018 +1100
Allow test fixtures and test methods to throw errors by default.
* test/testcase.vala (TestCase): Add a generic throws clause to both
TestMethod and set_up and tear_down, update subclasses.
.../application/geary-configuration-test.vala | 2 +-
test/client/components/client-web-view-test.vala | 4 +-
test/client/composer/composer-web-view-test.vala | 18 ++++----
test/engine/api/geary-attachment-test.vala | 17 ++++----
test/engine/api/geary-engine-test.vala | 4 +-
test/engine/app/app-conversation-set-test.vala | 20 ++++----
test/engine/app/app-conversation-test.vala | 10 ++--
.../engine/imap-engine/account-processor-test.vala | 16 ++++----
.../imap/command/imap-create-command-test.vala | 8 ++--
.../response/imap-namespace-response-test.vala | 16 ++++----
.../imap/transport/imap-deserializer-test.vala | 44 ++++++++++----------
test/engine/mime-content-type-test.vala | 8 ++--
test/engine/rfc822-mailbox-address-test.vala | 18 ++++----
test/engine/rfc822-mailbox-addresses-test.vala | 4 +-
test/engine/rfc822-message-data-test.vala | 2 +-
test/engine/rfc822-message-test.vala | 10 ++--
test/engine/rfc822-utils-test.vala | 2 +-
test/engine/util-html-test.vala | 16 ++++----
test/engine/util-idle-manager-test.vala | 4 +-
test/engine/util-inet-test.vala | 6 +-
test/engine/util-js-test.vala | 2 +-
test/engine/util-string-test.vala | 4 +-
test/engine/util-timeout-manager-test.vala | 14 +++---
test/js/client-page-state-test.vala | 2 +-
test/js/composer-page-state-test.vala | 26 ++++++------
test/js/conversation-page-state-test.vala | 16 ++++----
test/testcase.vala | 30 +++++++++----
27 files changed, 168 insertions(+), 155 deletions(-)
---
diff --git a/test/client/application/geary-configuration-test.vala
b/test/client/application/geary-configuration-test.vala
index 4ce33a2..fc8c18f 100644
--- a/test/client/application/geary-configuration-test.vala
+++ b/test/client/application/geary-configuration-test.vala
@@ -19,7 +19,7 @@ class ConfigurationTest : Gee.TestCase {
this.test_config = new Configuration(GearyApplication.APP_ID);
}
- public void desktop_environment() {
+ public void desktop_environment() throws Error {
assert(this.test_config.desktop_environment ==
Configuration.DesktopEnvironment.UNKNOWN);
diff --git a/test/client/components/client-web-view-test.vala
b/test/client/components/client-web-view-test.vala
index f222508..7ad3f2d 100644
--- a/test/client/components/client-web-view-test.vala
+++ b/test/client/components/client-web-view-test.vala
@@ -13,7 +13,7 @@ public class ClientWebViewTest : Gee.TestCase {
add_test("load_resources", load_resources);
}
- public void init_web_context() {
+ public void init_web_context() throws Error {
Configuration config = new Configuration(GearyApplication.APP_ID);
ClientWebView.init_web_context(
config,
@@ -23,7 +23,7 @@ public class ClientWebViewTest : Gee.TestCase {
);
}
- public void load_resources() {
+ public void load_resources() throws Error {
try {
ClientWebView.load_scripts();
} catch (Error err) {
diff --git a/test/client/composer/composer-web-view-test.vala
b/test/client/composer/composer-web-view-test.vala
index 3f9f0b6..f80d377 100644
--- a/test/client/composer/composer-web-view-test.vala
+++ b/test/client/composer/composer-web-view-test.vala
@@ -22,7 +22,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
add_test("get_text_with_nbsp", get_text_with_nbsp);
}
- public void load_resources() {
+ public void load_resources() throws Error {
try {
ComposerWebView.load_resources();
} catch (Error err) {
@@ -30,7 +30,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void edit_context() {
+ public void edit_context() throws Error {
assert(!(new ComposerWebView.EditContext("0,,,").is_link));
assert(new ComposerWebView.EditContext("1,,,").is_link);
assert(new ComposerWebView.EditContext("1,url,,").link_url == "url");
@@ -42,7 +42,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
assert(new ComposerWebView.EditContext("0,,,12").font_size == 12);
}
- public void get_html() {
+ public void get_html() throws Error {
string html = "<p>para</p>";
load_body_fixture(html);
this.test_view.get_html.begin((obj, ret) => { async_complete(ret); });
@@ -55,7 +55,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void get_text() {
+ public void get_text() throws Error {
load_body_fixture("<p>para</p>");
this.test_view.get_text.begin((obj, ret) => { async_complete(ret); });
try {
@@ -66,7 +66,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void get_text_with_quote() {
+ public void get_text_with_quote() throws Error {
load_body_fixture("<p>pre</p> <blockquote><p>quote</p></blockquote> <p>post</p>");
this.test_view.get_text.begin((obj, ret) => { async_complete(ret); });
try {
@@ -78,7 +78,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void get_text_with_nested_quote() {
+ public void get_text_with_nested_quote() throws Error {
load_body_fixture("<p>pre</p> <blockquote><p>quote1</p>
<blockquote><p>quote2</p></blockquote></blockquote> <p>post</p>");
this.test_view.get_text.begin((obj, ret) => { async_complete(ret); });
try {
@@ -90,7 +90,7 @@ public class ComposerWebViewTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void get_text_with_long_line() {
+ public void get_text_with_long_line() throws Error {
load_body_fixture("""
<p>A long, long, long, long, long, long para. Well, longer than MAX_BREAKABLE_LEN
at least. Really long, long, long, long, long long, long long, long long, long.</p>
@@ -112,7 +112,7 @@ long long, long long, long.
}
}
- public void get_text_with_long_quote() {
+ public void get_text_with_long_quote() throws Error {
load_body_fixture("""
<blockquote><p>A long, long, long, long, long, long line. Well, longer than MAX_BREAKABLE_LEN at
least.</p></blockquote>
@@ -138,7 +138,7 @@ long long, long long, long.
}
}
- public void get_text_with_nbsp() {
+ public void get_text_with_nbsp() throws Error {
load_body_fixture("""On Sun, Jan 1, 2017 at 9:55 PM, Michael Gratton <mike vee net> wrote:<br>
<blockquote
type="cite">long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long,
</blockquote><br>long, long, long, long, long, long, long, long, long, long, long, long, long, long, long,
long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long,
long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long,
long, long, long, long, long, long, long, <div style="white-space: pre;">
diff --git a/test/engine/api/geary-attachment-test.vala b/test/engine/api/geary-attachment-test.vala
index 5269c02..983cdd8 100644
--- a/test/engine/api/geary-attachment-test.vala
+++ b/test/engine/api/geary-attachment-test.vala
@@ -71,7 +71,7 @@ class Geary.AttachmentTest : Gee.TestCase {
}
}
- public void get_safe_file_name_with_content_name() {
+ public void get_safe_file_name_with_content_name() throws Error {
const string TEST_FILENAME = "test-filename.png";
Attachment test = new TestAttachment(
ATTACHMENT_ID,
@@ -91,7 +91,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == TEST_FILENAME);
}
- public void get_safe_file_name_with_bad_content_name() {
+ public void get_safe_file_name_with_bad_content_name() throws Error {
const string TEST_FILENAME = "test-filename.jpg";
const string RESULT_FILENAME = "test-filename.jpg.png";
Attachment test = new TestAttachment(
@@ -112,7 +112,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME);
}
- public void get_safe_file_name_with_bad_file_name() {
+ public void get_safe_file_name_with_bad_file_name() throws Error {
const string TEST_FILENAME = "test-filename";
const string RESULT_FILENAME = "test-filename.png";
Attachment test = new TestAttachment(
@@ -133,7 +133,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME);
}
- public void get_safe_file_name_with_no_content_name() {
+ public void get_safe_file_name_with_no_content_name() throws Error {
const string RESULT_FILENAME = CONTENT_ID + ".png";
Attachment test = new TestAttachment(
ATTACHMENT_ID,
@@ -153,7 +153,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME);
}
- public void get_safe_file_name_with_no_content_name_or_id() {
+ public void get_safe_file_name_with_no_content_name_or_id() throws Error {
const string RESULT_FILENAME = ATTACHMENT_ID + ".png";
Attachment test = new TestAttachment(
ATTACHMENT_ID,
@@ -173,7 +173,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME);
}
- public void get_safe_file_name_with_alt_file_name() {
+ public void get_safe_file_name_with_alt_file_name() throws Error {
const string ALT_TEXT = "some text";
const string RESULT_FILENAME = "some text.png";
Attachment test = new TestAttachment(
@@ -194,7 +194,7 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME);
}
- public void get_safe_file_name_with_default_content_type() {
+ public void get_safe_file_name_with_default_content_type() throws Error {
const string TEST_FILENAME = "test-filename.png";
Attachment test = new TestAttachment(
ATTACHMENT_ID,
@@ -214,7 +214,8 @@ class Geary.AttachmentTest : Gee.TestCase {
assert(test.get_safe_file_name.end(async_result()) == TEST_FILENAME);
}
- public void get_safe_file_name_with_default_content_type_bad_file_name() {
+ public void get_safe_file_name_with_default_content_type_bad_file_name()
+ throws Error {
const string TEST_FILENAME = "test-filename.jpg";
const string RESULT_FILENAME = "test-filename.jpg.png";
Attachment test = new TestAttachment(
diff --git a/test/engine/api/geary-engine-test.vala b/test/engine/api/geary-engine-test.vala
index c412f3b..c504dd2 100644
--- a/test/engine/api/geary-engine-test.vala
+++ b/test/engine/api/geary-engine-test.vala
@@ -72,7 +72,7 @@ class Geary.EngineTest : Gee.TestCase {
}
}
- public void create_orphan_account() {
+ public void create_orphan_account() throws Error {
try {
AccountInformation info = this.engine.create_orphan_account();
assert(info.id == "account_01");
@@ -94,7 +94,7 @@ class Geary.EngineTest : Gee.TestCase {
}
}
- public void create_orphan_account_with_legacy() {
+ public void create_orphan_account_with_legacy() throws Error {
try {
this.engine.add_account(
new AccountInformation("foo", this.config, this.data),
diff --git a/test/engine/app/app-conversation-set-test.vala b/test/engine/app/app-conversation-set-test.vala
index 00849af..51069e7 100644
--- a/test/engine/app/app-conversation-set-test.vala
+++ b/test/engine/app/app-conversation-set-test.vala
@@ -36,7 +36,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
);
}
- public void add_all_basic() {
+ public void add_all_basic() throws Error {
Email e1 = setup_email(1);
Email e2 = setup_email(2);
@@ -83,7 +83,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(removed.is_empty);
}
- public void add_all_duplicate() {
+ public void add_all_duplicate() throws Error {
Email e1 = setup_email(1);
Gee.LinkedList<Email> emails = new Gee.LinkedList<Email>();
@@ -131,7 +131,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(removed.is_empty);
}
- public void add_all_append_descendants() {
+ public void add_all_append_descendants() throws Error {
Email e1 = setup_email(1);
Email e2 = setup_email(2, e1);
@@ -203,7 +203,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(removed.is_empty);
}
- public void add_all_append_ancestors() {
+ public void add_all_append_ancestors() throws Error {
Email e1 = setup_email(1);
Email e2 = setup_email(2, e1);
@@ -240,7 +240,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(removed.is_empty);
}
- public void add_all_merge() {
+ public void add_all_merge() throws Error {
Email e1 = setup_email(1);
add_email_to_test_set(e1);
@@ -308,7 +308,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
}
- public void add_all_multi_path() {
+ public void add_all_multi_path() throws Error {
Email e1 = setup_email(1);
MockFolderRoot other_path = new MockFolderRoot("other");
@@ -336,7 +336,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(convo.get_folder_count(e1.id) == 2);
}
- public void add_all_append_path() {
+ public void add_all_append_path() throws Error {
Email e1 = setup_email(1);
add_email_to_test_set(e1);
@@ -369,7 +369,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(convo.get_folder_count(e1.id) == 2);
}
- public void remove_all_removed() {
+ public void remove_all_removed() throws Error {
Email e1 = setup_email(1);
add_email_to_test_set(e1);
@@ -395,7 +395,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(trimmed.size == 0);
}
- public void remove_all_trimmed() {
+ public void remove_all_trimmed() throws Error {
Email e1 = setup_email(1);
add_email_to_test_set(e1);
@@ -425,7 +425,7 @@ class Geary.App.ConversationSetTest : Gee.TestCase {
assert(trimmed.get(convo).contains(e1) == true);
}
- public void remove_all_remove_path() {
+ public void remove_all_remove_path() throws Error {
MockFolderRoot other_path = new MockFolderRoot("other");
Email e1 = setup_email(1);
add_email_to_test_set(e1, other_path);
diff --git a/test/engine/app/app-conversation-test.vala b/test/engine/app/app-conversation-test.vala
index 990408d..7a4eb2b 100644
--- a/test/engine/app/app-conversation-test.vala
+++ b/test/engine/app/app-conversation-test.vala
@@ -31,7 +31,7 @@ class Geary.App.ConversationTest : Gee.TestCase {
this.test = new Conversation(this.base_folder);
}
- public void add_basic() {
+ public void add_basic() throws Error {
Geary.Email e1 = setup_email(1);
Geary.Email e2 = setup_email(2);
uint appended = 0;
@@ -52,7 +52,7 @@ class Geary.App.ConversationTest : Gee.TestCase {
assert(this.test.get_count() == 2);
}
- public void add_duplicate() {
+ public void add_duplicate() throws Error {
Geary.Email e1 = setup_email(1);
uint appended = 0;
this.test.appended.connect(() => {
@@ -68,7 +68,7 @@ class Geary.App.ConversationTest : Gee.TestCase {
assert(this.test.get_count() == 1);
}
- public void add_multipath() {
+ public void add_multipath() throws Error {
Geary.Email e1 = setup_email(1);
this.test.add(e1, singleton(this.base_folder.path));
@@ -91,7 +91,7 @@ class Geary.App.ConversationTest : Gee.TestCase {
assert(this.test.get_folder_count(e1.id) == 1);
}
- public void remove_basic() {
+ public void remove_basic() throws Error {
Geary.Email e1 = setup_email(1);
this.test.add(e1, singleton(this.base_folder.path));
@@ -118,7 +118,7 @@ class Geary.App.ConversationTest : Gee.TestCase {
assert(this.test.get_count() == 0);
}
- public void remove_nonexistent() {
+ public void remove_nonexistent() throws Error {
Geary.Email e1 = setup_email(1);
Geary.Email e2 = setup_email(2);
diff --git a/test/engine/imap-engine/account-processor-test.vala
b/test/engine/imap-engine/account-processor-test.vala
index 15a112f..44e7baf 100644
--- a/test/engine/imap-engine/account-processor-test.vala
+++ b/test/engine/imap-engine/account-processor-test.vala
@@ -58,10 +58,10 @@ public class Geary.ImapEngine.AccountProcessorTest : Gee.TestCase {
public AccountProcessorTest() {
base("Geary.ImapEngine.AccountProcessorTest");
- add_test("test_success", test_success);
- add_test("test_failure", test_failure);
- add_test("test_duplicate", test_duplicate);
- add_test("test_stop", test_stop);
+ add_test("success", success);
+ add_test("failure", failure);
+ add_test("duplicate", duplicate);
+ add_test("stop", stop);
// XXX this has to be here instead of in set_up for some
// reason...
@@ -81,7 +81,7 @@ public class Geary.ImapEngine.AccountProcessorTest : Gee.TestCase {
this.completed = 0;
}
- public void test_success() {
+ public void success() throws Error {
TestOperation op = setup_operation(new TestOperation(this.account));
this.processor.enqueue(op);
@@ -95,7 +95,7 @@ public class Geary.ImapEngine.AccountProcessorTest : Gee.TestCase {
assert(this.completed == 1);
}
- public void test_failure() {
+ public void failure() throws Error {
TestOperation op = setup_operation(new TestOperation(this.account));
op.throw_error = true;
@@ -116,7 +116,7 @@ public class Geary.ImapEngine.AccountProcessorTest : Gee.TestCase {
assert(error is AccountProcessorTestError.TEST);
}
- public void test_duplicate() {
+ public void duplicate() throws Error {
TestOperation op1 = setup_operation(new TestOperation(this.account));
TestOperation op2 = setup_operation(new TestOperation(this.account));
TestOperation op3 = setup_operation(new OtherOperation(this.account));
@@ -129,7 +129,7 @@ public class Geary.ImapEngine.AccountProcessorTest : Gee.TestCase {
assert(this.processor.waiting == 2);
}
- public void test_stop() {
+ public void stop() throws Error {
TestOperation op1 = setup_operation(new TestOperation(this.account));
op1.wait_for_cancel = true;
TestOperation op2 = setup_operation(new OtherOperation(this.account));
diff --git a/test/engine/imap/command/imap-create-command-test.vala
b/test/engine/imap/command/imap-create-command-test.vala
index bcb5af9..9e3fe14 100644
--- a/test/engine/imap/command/imap-create-command-test.vala
+++ b/test/engine/imap/command/imap-create-command-test.vala
@@ -10,16 +10,16 @@ class Geary.Imap.CreateCommandTest : Gee.TestCase {
public CreateCommandTest() {
base("Geary.Imap.CreateCommandTest");
- add_test("test_basic_create", test_basic_create);
- add_test("test_special_use", test_special_use);
+ add_test("basic_create", basic_create);
+ add_test("special_use", special_use);
}
- public void test_basic_create() {
+ public void basic_create() throws Error {
assert(new CreateCommand(new MailboxSpecifier("owatagusiam/")).to_string() ==
"---- create owatagusiam/");
}
- public void test_special_use() {
+ public void special_use() throws Error {
assert(new CreateCommand.special_use(
new MailboxSpecifier("Everything"),
SpecialFolderType.ALL_MAIL
diff --git a/test/engine/imap/response/imap-namespace-response-test.vala
b/test/engine/imap/response/imap-namespace-response-test.vala
index 04a19ba..c4fd432 100644
--- a/test/engine/imap/response/imap-namespace-response-test.vala
+++ b/test/engine/imap/response/imap-namespace-response-test.vala
@@ -10,13 +10,13 @@ class Geary.Imap.NamespaceResponseTest : Gee.TestCase {
public NamespaceResponseTest() {
base("Geary.Imap.NamespaceResponseTest");
- add_test("test_minimal", test_minimal);
- add_test("test_complete", test_complete);
- add_test("test_cyrus", test_cyrus);
- add_test("test_anonymous", test_anonymous);
+ add_test("minimal", minimal);
+ add_test("complete", complete);
+ add_test("cyrus", cyrus);
+ add_test("anonymous", anonymous);
}
- public void test_minimal() {
+ public void minimal() throws Error {
// * NAMESPACE NIL NIL NIL
try {
ServerData data = newNamespaceServerData(null, null, null);
@@ -30,7 +30,7 @@ class Geary.Imap.NamespaceResponseTest : Gee.TestCase {
}
}
- public void test_complete() {
+ public void complete() throws Error {
// * NAMESPACE (("" "/")) (("~" "/")) (("#shared/" "/")
ListParameter personal = new ListParameter();
personal.add(newNamespace("", "/"));
@@ -61,7 +61,7 @@ class Geary.Imap.NamespaceResponseTest : Gee.TestCase {
}
}
- public void test_cyrus() {
+ public void cyrus() throws Error {
// * NAMESPACE (("INBOX." ".")) NIL (("" "."))
ListParameter personal = new ListParameter();
personal.add(newNamespace("INBOX.", "."));
@@ -84,7 +84,7 @@ class Geary.Imap.NamespaceResponseTest : Gee.TestCase {
}
}
- public void test_anonymous() {
+ public void anonymous() throws Error {
// * NAMESPACE NIL NIL (("" "."))
ListParameter shared = new ListParameter();
shared.add(newNamespace("", ","));
diff --git a/test/engine/imap/transport/imap-deserializer-test.vala
b/test/engine/imap/transport/imap-deserializer-test.vala
index d8b1f1a..71b55ba 100644
--- a/test/engine/imap/transport/imap-deserializer-test.vala
+++ b/test/engine/imap/transport/imap-deserializer-test.vala
@@ -19,21 +19,21 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
public DeserializerTest() {
base("Geary.Imap.DeserializerTest");
- add_test("test_gmail_greeting", test_gmail_greeting);
- add_test("test_cyrus_2_4_greeting", test_cyrus_2_4_greeting);
- add_test("test_aliyun_greeting", test_aliyun_greeting);
+ add_test("gmail_greeting", gmail_greeting);
+ add_test("cyrus_2_4_greeting", cyrus_2_4_greeting);
+ add_test("aliyun_greeting", aliyun_greeting);
- add_test("test_invalid_atom_prefix", test_invalid_atom_prefix);
+ add_test("invalid_atom_prefix", invalid_atom_prefix);
- add_test("test_gmail_flags", test_gmail_flags);
- add_test("test_gmail_permanent_flags", test_gmail_permanent_flags);
- add_test("test_cyrus_flags", test_cyrus_flags);
+ add_test("gmail_flags", gmail_flags);
+ add_test("gmail_permanent_flags", gmail_permanent_flags);
+ add_test("cyrus_flags", cyrus_flags);
- add_test("test_runin_special_flag", test_runin_special_flag);
- add_test("test_invalid_flag_prefix", test_invalid_flag_prefix);
+ add_test("runin_special_flag", runin_special_flag);
+ add_test("invalid_flag_prefix", invalid_flag_prefix);
- add_test("test_instant_eos", test_instant_eos);
- add_test("test_bye_eos", test_bye_eos);
+ add_test("instant_eos", instant_eos);
+ add_test("bye_eos", bye_eos);
}
public override void set_up() {
@@ -46,7 +46,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
async_result();
}
- public void test_gmail_greeting() {
+ public void gmail_greeting() throws Error {
string greeting = "* OK Gimap ready for requests from 115.187.245.46 c194mb399904375ivc";
this.stream.add_data(greeting.data);
this.stream.add_data(EOL.data);
@@ -57,7 +57,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == greeting);
}
- public void test_cyrus_2_4_greeting() {
+ public void cyrus_2_4_greeting() throws Error {
string greeting = "* OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN SASL-IR] mogul Cyrus
IMAP v2.4.12-Debian-2.4.12-2 server ready";
this.stream.add_data(greeting.data);
this.stream.add_data(EOL.data);
@@ -68,7 +68,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == greeting);
}
- public void test_aliyun_greeting() {
+ public void aliyun_greeting() throws Error {
string greeting = "* OK AliYun IMAP Server Ready(10.147.40.164)";
string parsed = "* OK AliYun IMAP Server Ready (10.147.40.164)";
this.stream.add_data(greeting.data);
@@ -80,7 +80,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == parsed);
}
- public void test_invalid_atom_prefix() {
+ public void invalid_atom_prefix() throws Error {
string flags = """* OK %atom""";
this.stream.add_data(flags.data);
this.stream.add_data(EOL.data);
@@ -89,7 +89,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
this.process.end(async_result());
}
- public void test_gmail_flags() {
+ public void gmail_flags() throws Error {
string flags = """* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)""";
this.stream.add_data(flags.data);
this.stream.add_data(EOL.data);
@@ -100,7 +100,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == flags);
}
- public void test_gmail_permanent_flags() {
+ public void gmail_permanent_flags() throws Error {
string flags = """* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing
$Phishing \*)] Flags permitted.""";
this.stream.add_data(flags.data);
this.stream.add_data(EOL.data);
@@ -111,7 +111,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == flags);
}
- public void test_cyrus_flags() {
+ public void cyrus_flags() throws Error {
string flags = """* 2934 FETCH (FLAGS (\Answered \Seen $Quuxo::Spam::Trained) UID 3041)""";
this.stream.add_data(flags.data);
this.stream.add_data(EOL.data);
@@ -122,7 +122,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == flags);
}
- public void test_runin_special_flag() {
+ public void runin_special_flag() throws Error {
// since we must terminate a special flag upon receiving the
// '*', the following atom will be treated as a run-on but
// distinct atom.
@@ -137,7 +137,7 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
assert(message.to_string() == expected);
}
- public void test_invalid_flag_prefix() {
+ public void invalid_flag_prefix() throws Error {
string flags = """* OK \%atom""";
this.stream.add_data(flags.data);
this.stream.add_data(EOL.data);
@@ -146,13 +146,13 @@ class Geary.Imap.DeserializerTest : Gee.TestCase {
this.process.end(async_result());
}
- public void test_instant_eos() {
+ public void instant_eos() throws Error {
this.process.begin(Expect.EOS, (obj, ret) => { async_complete(ret); });
this.process.end(async_result());
assert(this.deser.is_halted());
}
- public void test_bye_eos() {
+ public void bye_eos() throws Error {
string bye = """* OK bye""";
this.stream.add_data(bye.data);
diff --git a/test/engine/mime-content-type-test.vala b/test/engine/mime-content-type-test.vala
index 951cffa..4c4800b 100644
--- a/test/engine/mime-content-type-test.vala
+++ b/test/engine/mime-content-type-test.vala
@@ -15,16 +15,16 @@ class Geary.Mime.ContentTypeTest : Gee.TestCase {
add_test("guess_type_from_buf", guess_type_from_buf);
}
- public void is_default() {
+ public void is_default() throws Error {
assert(new ContentType("application", "octet-stream", null).is_default());
}
- public void get_file_name_extension() {
+ public void get_file_name_extension() throws Error {
assert(new ContentType("image", "jpeg", null).get_file_name_extension() == ".jpeg");
assert(new ContentType("test", "unknown", null).get_file_name_extension() == null);
}
- public void guess_type_from_name() {
+ public void guess_type_from_name() throws Error {
try {
assert(ContentType.guess_type("test.png", null).is_type("image", "png"));
} catch (Error err) {
@@ -38,7 +38,7 @@ class Geary.Mime.ContentTypeTest : Gee.TestCase {
}
}
- public void guess_type_from_buf() {
+ public void guess_type_from_buf() throws Error {
Memory.ByteBuffer png = new Memory.ByteBuffer(
{0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}, 8 // PNG magic
);
diff --git a/test/engine/rfc822-mailbox-address-test.vala b/test/engine/rfc822-mailbox-address-test.vala
index 8426c0e..1ab923c 100644
--- a/test/engine/rfc822-mailbox-address-test.vala
+++ b/test/engine/rfc822-mailbox-address-test.vala
@@ -21,7 +21,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
add_test("to_rfc822_string", to_rfc822_string);
}
- public void is_valid_address() {
+ public void is_valid_address() throws Error {
assert(Geary.RFC822.MailboxAddress.is_valid_address("john dep aol.museum") == true);
assert(Geary.RFC822.MailboxAddress.is_valid_address("test example com") == true);
assert(Geary.RFC822.MailboxAddress.is_valid_address("test other example com") == true);
@@ -39,7 +39,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
assert(Geary.RFC822.MailboxAddress.is_valid_address("") == false);
}
- public void unescaped_constructor() {
+ public void unescaped_constructor() throws Error {
MailboxAddress addr1 = new MailboxAddress("test1", "test2 example com");
assert(addr1.name == "test1");
assert(addr1.address == "test2 example com");
@@ -67,7 +67,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
assert(addr5.domain == "");
}
- public void from_rfc822_string_encoded() {
+ public void from_rfc822_string_encoded() throws Error {
try {
MailboxAddress addr = new MailboxAddress.from_rfc822_string("test example com");
assert(addr.name == null);
@@ -148,7 +148,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
}
}
- public void is_spoofed() {
+ public void is_spoofed() throws Error {
assert(new MailboxAddress(null, "example example com").is_spoofed() == false);
assert(new MailboxAddress("", "example example com").is_spoofed() == false);
assert(new MailboxAddress("", "example example com").is_spoofed() == false);
@@ -173,7 +173,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
}
}
- public void has_distinct_name() {
+ public void has_distinct_name() throws Error {
assert(new MailboxAddress("example", "example example com").has_distinct_name() == true);
assert(new MailboxAddress("", "example example com").has_distinct_name() == false);
@@ -183,7 +183,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
assert(new MailboxAddress(" example example com ", "example example com").has_distinct_name() ==
false);
}
- public void to_full_display() {
+ public void to_full_display() throws Error {
assert(new MailboxAddress("", "example example com").to_full_display() ==
"example example com");
assert(new MailboxAddress("Test", "example example com").to_full_display() ==
@@ -194,7 +194,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
"example@example example com");
}
- public void to_short_display() {
+ public void to_short_display() throws Error {
assert(new MailboxAddress("", "example example com").to_short_display() ==
"example example com");
assert(new MailboxAddress("Test", "example example com").to_short_display() ==
@@ -205,7 +205,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
"example@example example com");
}
- public void to_rfc822_address() {
+ public void to_rfc822_address() throws Error {
assert(new MailboxAddress(null, "example example com").to_rfc822_address() ==
"example example com");
//assert(new MailboxAddress(null, "test test example com").to_rfc822_address() ==
@@ -222,7 +222,7 @@ class Geary.RFC822.MailboxAddressTest : Gee.TestCase {
"\"=?UTF-8?b?8J+YuA==?=\"@example.com");
}
- public void to_rfc822_string() {
+ public void to_rfc822_string() throws Error {
assert(new MailboxAddress("", "example example com").to_rfc822_string() ==
"example example com");
assert(new MailboxAddress(" ", "example example com").to_rfc822_string() ==
diff --git a/test/engine/rfc822-mailbox-addresses-test.vala b/test/engine/rfc822-mailbox-addresses-test.vala
index 3d91d6e..706d2d8 100644
--- a/test/engine/rfc822-mailbox-addresses-test.vala
+++ b/test/engine/rfc822-mailbox-addresses-test.vala
@@ -13,7 +13,7 @@ class Geary.RFC822.MailboxAddressesTest : Gee.TestCase {
add_test("to_rfc822_string", to_rfc822_string);
}
- public void from_rfc822_string_encoded() {
+ public void from_rfc822_string_encoded() throws Error {
MailboxAddresses addrs = new MailboxAddresses.from_rfc822_string("test example com");
assert(addrs.size == 1);
@@ -29,7 +29,7 @@ class Geary.RFC822.MailboxAddressesTest : Gee.TestCase {
assert(addrs.size == 2);
}
- public void to_rfc822_string() {
+ public void to_rfc822_string() throws Error {
assert(new MailboxAddresses().to_rfc822_string() == "");
assert(new_addreses({ "test1 example com" })
.to_rfc822_string() == "test1 example com");
diff --git a/test/engine/rfc822-message-data-test.vala b/test/engine/rfc822-message-data-test.vala
index 9d8ec34..728f37f 100644
--- a/test/engine/rfc822-message-data-test.vala
+++ b/test/engine/rfc822-message-data-test.vala
@@ -12,7 +12,7 @@ class Geary.RFC822.MessageDataTest : Gee.TestCase {
add_test("PreviewText.with_header", preview_text_with_header);
}
- public void preview_text_with_header() {
+ public void preview_text_with_header() throws Error {
PreviewText plain_preview1 = new PreviewText.with_header(
new Geary.Memory.StringBuffer(PLAIN_BODY1_ENCODED),
new Geary.Memory.StringBuffer(PLAIN_BODY1_HEADERS)
diff --git a/test/engine/rfc822-message-test.vala b/test/engine/rfc822-message-test.vala
index 664e4b6..4d5b6d4 100644
--- a/test/engine/rfc822-message-test.vala
+++ b/test/engine/rfc822-message-test.vala
@@ -16,7 +16,7 @@ class Geary.RFC822.MessageTest : Gee.TestCase {
add_test("get_preview", get_preview);
}
- public void basic_message_from_buffer() {
+ public void basic_message_from_buffer() throws Error {
Message? basic = null;
try {
basic = string_to_message(BASIC_MESSAGE);
@@ -37,7 +37,7 @@ class Geary.RFC822.MessageTest : Gee.TestCase {
assert(basic.mailer == "Geary Test Suite 1.0");
}
- public void encoded_recipient() {
+ public void encoded_recipient() throws Error {
Message? enc = null;
try {
enc = string_to_message(ENCODED_TO);
@@ -49,7 +49,7 @@ class Geary.RFC822.MessageTest : Gee.TestCase {
assert(enc.to[0].name == "potus whitehouse gov <test>");
}
- public void duplicate_mailbox() {
+ public void duplicate_mailbox() throws Error {
Message? dup = null;
try {
dup = string_to_message(DUPLICATE_TO);
@@ -63,7 +63,7 @@ class Geary.RFC822.MessageTest : Gee.TestCase {
);
}
- public void duplicate_message_id() {
+ public void duplicate_message_id() throws Error {
Message? dup = null;
try {
dup = string_to_message(DUPLICATE_REFERENCES);
@@ -77,7 +77,7 @@ class Geary.RFC822.MessageTest : Gee.TestCase {
);
}
- public void get_preview() {
+ public void get_preview() throws Error {
try {
Message multipart_signed = string_to_message(MULTIPART_SIGNED_MESSAGE_TEXT);
assert(multipart_signed.get_preview() == MULTIPART_SIGNED_MESSAGE_PREVIEW);
diff --git a/test/engine/rfc822-utils-test.vala b/test/engine/rfc822-utils-test.vala
index 2af01f7..a94cc79 100644
--- a/test/engine/rfc822-utils-test.vala
+++ b/test/engine/rfc822-utils-test.vala
@@ -12,7 +12,7 @@ class Geary.RFC822.Utils.Test : Gee.TestCase {
add_test("to_preview_text", to_preview_text);
}
- public void to_preview_text() {
+ public void to_preview_text() throws 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/engine/util-html-test.vala b/test/engine/util-html-test.vala
index 4a6bf6c..87b7dec 100644
--- a/test/engine/util-html-test.vala
+++ b/test/engine/util-html-test.vala
@@ -19,42 +19,42 @@ class Geary.HTML.UtilTest : Gee.TestCase {
add_test("remove_html_tags", remove_html_tags);
}
- public void smart_escape_div() {
+ public void smart_escape_div() throws Error {
string html = "<div>ohhai</div>";
assert(Geary.HTML.smart_escape(html, false) == html);
}
- public void smart_escape_no_closing_tag() {
+ public void smart_escape_no_closing_tag() throws Error {
string html = "<div>ohhai";
assert(Geary.HTML.smart_escape(html, false) == html);
}
- public void smart_escape_img() {
+ public void smart_escape_img() throws Error {
string html = "<img src=\"http://example.com/lol.gif\">";
assert(Geary.HTML.smart_escape(html, false) == html);
}
- public void smart_escape_xhtml_img() {
+ public void smart_escape_xhtml_img() throws Error {
string html = "<img src=\"http://example.com/lol.gif\"/>";
assert(Geary.HTML.smart_escape(html, false) == html);
}
- public void smart_escape_mixed() {
+ public void smart_escape_mixed() throws Error {
string html = "mixed <div>ohhai</div> text";
assert(Geary.HTML.smart_escape(html, false) == html);
}
- public void smart_escape_text() {
+ public void smart_escape_text() throws Error {
string text = "some text";
assert(Geary.HTML.smart_escape(text, false) == "<div style='white-space: pre-wrap;'>some
text</div>");
}
- public void smart_escape_text_url() {
+ public void smart_escape_text_url() throws Error {
string text = "<http://example.com>";
assert(Geary.HTML.smart_escape(text, false) == "<div style='white-space:
pre-wrap;'><http://example.com></div>");
}
- public void remove_html_tags() {
+ public void remove_html_tags() throws Error {
string blockquote_body = """<blockquote>hello</blockquote> <p>there</p>""";
string style_complete = """<style>
diff --git a/test/engine/util-idle-manager-test.vala b/test/engine/util-idle-manager-test.vala
index 1af857b..6a049d2 100644
--- a/test/engine/util-idle-manager-test.vala
+++ b/test/engine/util-idle-manager-test.vala
@@ -13,7 +13,7 @@ class Geary.IdleManagerTest : Gee.TestCase {
add_test("test_run", test_run);
}
- public void start_reset() {
+ public void start_reset() throws Error {
IdleManager test = new IdleManager(() => { /* noop */ });
assert(!test.is_running);
test.schedule();
@@ -22,7 +22,7 @@ class Geary.IdleManagerTest : Gee.TestCase {
assert(!test.is_running);
}
- public void test_run() {
+ public void test_run() throws Error {
bool did_run = false;
IdleManager test = new IdleManager(() => { did_run = true; });
diff --git a/test/engine/util-inet-test.vala b/test/engine/util-inet-test.vala
index cae052d..13acf68 100644
--- a/test/engine/util-inet-test.vala
+++ b/test/engine/util-inet-test.vala
@@ -14,7 +14,7 @@ class Geary.Inet.Test : Gee.TestCase {
add_test("is_valid_display_host_ipv6", is_valid_display_host_ipv6);
}
- public void is_valid_display_host_dns() {
+ public void is_valid_display_host_dns() throws Error {
assert(is_valid_display_host("foo"));
assert(is_valid_display_host("Foo"));
assert(is_valid_display_host("Ƒoo"));
@@ -33,7 +33,7 @@ class Geary.Inet.Test : Gee.TestCase {
assert(!is_valid_display_host("foo-"));
}
- public void is_valid_display_host_ipv4() {
+ public void is_valid_display_host_ipv4() throws Error {
assert(is_valid_display_host("123.123.123.123"));
assert(is_valid_display_host("127.0.0.1"));
@@ -44,7 +44,7 @@ class Geary.Inet.Test : Gee.TestCase {
//assert(is_valid_display_host("666.123.123.123"));
}
- public void is_valid_display_host_ipv6() {
+ public void is_valid_display_host_ipv6() throws Error {
assert(is_valid_display_host("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210"));
assert(is_valid_display_host("1080:0:0:0:8:800:200C:4171"));
assert(is_valid_display_host("3ffe:2a00:100:7031::1"));
diff --git a/test/engine/util-js-test.vala b/test/engine/util-js-test.vala
index eb087cc..66e8388 100644
--- a/test/engine/util-js-test.vala
+++ b/test/engine/util-js-test.vala
@@ -12,7 +12,7 @@ public class Geary.JS.Test : Gee.TestCase {
add_test("escape_string", escape_string);
}
- public void escape_string() {
+ public void escape_string() throws Error {
assert(Geary.JS.escape_string("\n") == """\n""");
assert(Geary.JS.escape_string("\r") == """\r""");
assert(Geary.JS.escape_string("\t") == """\t""");
diff --git a/test/engine/util-string-test.vala b/test/engine/util-string-test.vala
index 64b0077..cb4db93 100644
--- a/test/engine/util-string-test.vala
+++ b/test/engine/util-string-test.vala
@@ -13,7 +13,7 @@ class Geary.String.Test : Gee.TestCase {
add_test("test_nonprinting", test_nonprinting);
}
- public void test_whitespace() {
+ public void test_whitespace() throws Error {
assert(reduce_whitespace("") == "");
assert(reduce_whitespace(" ") == "");
assert(reduce_whitespace(" ") == "");
@@ -36,7 +36,7 @@ class Geary.String.Test : Gee.TestCase {
assert(reduce_whitespace("test\ttest") == "test test");
}
- public void test_nonprinting() {
+ public void test_nonprinting() throws Error {
assert(reduce_whitespace("\0") == ""); // NUL
assert(reduce_whitespace("\u00A0") == ""); // ENQUIRY
assert(reduce_whitespace("\u00A0") == ""); // NO-BREAK SPACE
diff --git a/test/engine/util-timeout-manager-test.vala b/test/engine/util-timeout-manager-test.vala
index 8f2d040..6a55ea0 100644
--- a/test/engine/util-timeout-manager-test.vala
+++ b/test/engine/util-timeout-manager-test.vala
@@ -16,13 +16,13 @@ class Geary.TimeoutManagerTest : Gee.TestCase {
base("Geary.TimeoutManagerTest");
add_test("start_reset", start_reset);
if (Test.slow()) {
- add_test("test_seconds", test_seconds);
- add_test("test_milliseconds", test_milliseconds);
- add_test("test_repeat_forever", test_repeat_forever);
+ add_test("seconds", seconds);
+ add_test("milliseconds", milliseconds);
+ add_test("repeat_forever", repeat_forever);
}
}
- public void start_reset() {
+ public void start_reset() throws Error {
TimeoutManager test = new TimeoutManager.seconds(1, () => { /* noop */ });
assert(!test.is_running);
test.start();
@@ -31,7 +31,7 @@ class Geary.TimeoutManagerTest : Gee.TestCase {
assert(!test.is_running);
}
- public void test_seconds() {
+ public void seconds() throws Error {
Timer timer = new Timer();
TimeoutManager test = new TimeoutManager.seconds(1, () => { timer.stop(); });
@@ -45,7 +45,7 @@ class Geary.TimeoutManagerTest : Gee.TestCase {
assert_epsilon(timer.elapsed(), 1.0, SECONDS_EPSILON);
}
- public void test_milliseconds() {
+ public void milliseconds() throws Error {
Timer timer = new Timer();
TimeoutManager test = new TimeoutManager.milliseconds(100, () => { timer.stop(); });
@@ -59,7 +59,7 @@ class Geary.TimeoutManagerTest : Gee.TestCase {
assert_epsilon(timer.elapsed(), 0.1, MILLISECONDS_EPSILON);
}
- public void test_repeat_forever() {
+ public void repeat_forever() throws Error {
Timer timer = new Timer();
int count = 0;
diff --git a/test/js/client-page-state-test.vala b/test/js/client-page-state-test.vala
index 57e02cc..3da1c22 100644
--- a/test/js/client-page-state-test.vala
+++ b/test/js/client-page-state-test.vala
@@ -20,7 +20,7 @@ class ClientPageStateTest : ClientWebViewTestCase<ClientWebView> {
}
- public void content_loaded() {
+ public void content_loaded() throws Error {
bool content_loaded_triggered = false;
this.test_view.content_loaded.connect(() => {
content_loaded_triggered = true;
diff --git a/test/js/composer-page-state-test.vala b/test/js/composer-page-state-test.vala
index 6afd609..be658b2 100644
--- a/test/js/composer-page-state-test.vala
+++ b/test/js/composer-page-state-test.vala
@@ -34,7 +34,7 @@ class ComposerPageStateTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void edit_context_link() {
+ public void edit_context_link() throws Error {
string html = "<a id=\"test\" href=\"url\">para</a>";
load_body_fixture(html);
@@ -50,7 +50,7 @@ class ComposerPageStateTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void edit_context_font() {
+ public void edit_context_font() throws Error {
string html = "<p id=\"test\" style=\"font-family: Comic Sans; font-size: 144\">para</p>";
load_body_fixture(html);
@@ -66,7 +66,7 @@ class ComposerPageStateTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void indent_line() {
+ public void indent_line() throws Error {
load_body_fixture("""<span id="test">some text</span>""");
try {
run_javascript(@"SelectionUtil.selectNode(document.getElementById('test'))");
@@ -83,7 +83,7 @@ class ComposerPageStateTest : ClientWebViewTestCase<ComposerWebView> {
}
}
- public void contains_attachment_keywords() {
+ public void contains_attachment_keywords() throws Error {
load_body_fixture_full("""
<blockquote>innerquote</blockquote>
@@ -120,7 +120,7 @@ some text
}
}
- public void clean_content() {
+ public void clean_content() throws Error {
// XXX split these up into multiple tests
load_body_fixture("""
http://example1.com
@@ -159,7 +159,7 @@ unknown://example6.com
}
}
- public void get_html() {
+ public void get_html() throws Error {
string html = "<p>para</p>";
load_body_fixture(html);
try {
@@ -174,7 +174,7 @@ unknown://example6.com
}
}
- public void get_text() {
+ public void get_text() throws Error {
load_body_fixture("<p>para</p>");
try {
assert(WebKitUtil.to_string(run_javascript(@"window.geary.getText();")) ==
@@ -188,7 +188,7 @@ unknown://example6.com
}
}
- public void get_text_with_quote() {
+ public void get_text_with_quote() throws Error {
unichar q_marker = Geary.RFC822.Utils.QUOTE_MARKER;
load_body_fixture("<p>pre</p> <blockquote><p>quote</p></blockquote> <p>post</p>");
try {
@@ -203,7 +203,7 @@ unknown://example6.com
}
}
- public void get_text_with_nested_quote() {
+ public void get_text_with_nested_quote() throws Error {
unichar q_marker = Geary.RFC822.Utils.QUOTE_MARKER;
load_body_fixture("<p>pre</p> <blockquote><p>quote1</p>
<blockquote><p>quote2</p></blockquote></blockquote> <p>post</p>");
try {
@@ -218,7 +218,7 @@ unknown://example6.com
}
}
- public void contains_keywords() {
+ public void contains_keywords() throws Error {
load_body_fixture();
string complete_keys = """new Set(["keyword1", "keyword2"])""";
string suffix_keys = """new Set(["sf1", "sf2"])""";
@@ -271,7 +271,7 @@ unknown://example6.com
}
}
- public void resolve_nesting() {
+ public void resolve_nesting() throws Error {
load_body_fixture();
unichar q_marker = Geary.RFC822.Utils.QUOTE_MARKER;
unichar q_start = '';
@@ -305,7 +305,7 @@ unknown://example6.com
}
}
- public void quote_lines() {
+ public void quote_lines() throws Error {
load_body_fixture();
unichar q_marker = Geary.RFC822.Utils.QUOTE_MARKER;
try {
@@ -324,7 +324,7 @@ unknown://example6.com
}
}
- public void replace_non_breaking_space() {
+ public void replace_non_breaking_space() throws Error {
load_body_fixture();
string single_nbsp = "a b";
string multiple_nbsp = "a b c";
diff --git a/test/js/conversation-page-state-test.vala b/test/js/conversation-page-state-test.vala
index a847163..7a8c276 100644
--- a/test/js/conversation-page-state-test.vala
+++ b/test/js/conversation-page-state-test.vala
@@ -25,49 +25,49 @@ class ConversationPageStateTest : ClientWebViewTestCase<ConversationWebView> {
}
}
- public void is_deceptive_text_not_url() {
+ public void is_deceptive_text_not_url() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("ohhai!", "http://example.com") ==
ConversationWebView.DeceptiveText.NOT_DECEPTIVE);
}
- public void is_deceptive_text_identical_text() {
+ public void is_deceptive_text_identical_text() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("http://example.com", "http://example.com") ==
ConversationWebView.DeceptiveText.NOT_DECEPTIVE);
}
- public void is_deceptive_text_matching_url() {
+ public void is_deceptive_text_matching_url() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("example.com", "http://example.com") ==
ConversationWebView.DeceptiveText.NOT_DECEPTIVE);
}
- public void is_deceptive_text_common_href_subdomain() {
+ public void is_deceptive_text_common_href_subdomain() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("example.com", "http://foo.example.com") ==
ConversationWebView.DeceptiveText.NOT_DECEPTIVE);
}
- public void is_deceptive_text_common_text_subdomain() {
+ public void is_deceptive_text_common_text_subdomain() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("www.example.com", "http://example.com") ==
ConversationWebView.DeceptiveText.NOT_DECEPTIVE);
}
- public void is_deceptive_text_deceptive_href() {
+ public void is_deceptive_text_deceptive_href() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("www.example.com", "ohhai!") ==
ConversationWebView.DeceptiveText.DECEPTIVE_HREF);
}
- public void is_deceptive_text_non_matching_subdomain() {
+ public void is_deceptive_text_non_matching_subdomain() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("www.example.com", "phishing.com") ==
ConversationWebView.DeceptiveText.DECEPTIVE_DOMAIN);
}
- public void is_deceptive_text_different_domain() {
+ public void is_deceptive_text_different_domain() throws Error {
load_body_fixture("<p>my hovercraft is full of eels</p>");
assert(exec_is_deceptive_text("www.example.com", "phishing.net") ==
ConversationWebView.DeceptiveText.DECEPTIVE_DOMAIN);
diff --git a/test/testcase.vala b/test/testcase.vala
index bb94df4..2fcde01 100644
--- a/test/testcase.vala
+++ b/test/testcase.vala
@@ -30,7 +30,7 @@ public abstract class Gee.TestCase : Object {
private Adaptor[] adaptors = new Adaptor[0];
private AsyncQueue<AsyncResult> async_results = new AsyncQueue<AsyncResult>();
- public delegate void TestMethod ();
+ public delegate void TestMethod() throws Error;
public TestCase (string name) {
this.suite = new GLib.TestSuite (name);
@@ -46,10 +46,10 @@ public abstract class Gee.TestCase : Object {
adaptor.tear_down ));
}
- public virtual void set_up () {
+ public virtual void set_up() throws Error {
}
- public virtual void tear_down () {
+ public virtual void tear_down() throws Error {
}
public GLib.TestSuite get_suite () {
@@ -86,16 +86,28 @@ public abstract class Gee.TestCase : Object {
this.test_case = test_case;
}
- public void set_up (void* fixture) {
- this.test_case.set_up ();
+ public void set_up(void* fixture) {
+ try {
+ this.test_case.set_up();
+ } catch (Error err) {
+ assert_no_error(err);
+ }
}
- public void run (void* fixture) {
- this.test ();
+ public void run(void* fixture) {
+ try {
+ this.test ();
+ } catch (Error err) {
+ assert_no_error(err);
+ }
}
- public void tear_down (void* fixture) {
- this.test_case.tear_down ();
+ public void tear_down(void* fixture) {
+ try {
+ this.test_case.tear_down();
+ } catch (Error err) {
+ assert_no_error(err);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]