[libpeas] Simplify test hook pop message generation
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Simplify test hook pop message generation
- Date: Tue, 22 Sep 2015 08:09:59 +0000 (UTC)
commit 3900941734f16ea1c9f6b22768d79bfa6ba7889b
Author: Garrett Regier <garrettregier gmail com>
Date: Mon Sep 21 22:10:33 2015 -0700
Simplify test hook pop message generation
tests/testing-util/testing-util.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/tests/testing-util/testing-util.c b/tests/testing-util/testing-util.c
index 396f2bf..e486dfd 100644
--- a/tests/testing-util/testing-util.c
+++ b/tests/testing-util/testing-util.c
@@ -341,20 +341,22 @@ testing_util_pop_log_hooks (void)
msg = g_string_new ("");
if (unhit_hooks->len != 0)
- g_string_append (msg, "Log hooks were not triggered:");
-
- if (unhit_hooks->len == 1)
- {
- hook = g_ptr_array_index (unhit_hooks, 0);
- g_string_append_printf (msg, " '%s'", hook->pattern);
- }
- else if (unhit_hooks->len > 1)
{
- for (i = 0; i < unhit_hooks->len; ++i)
+ g_string_append (msg, "Log hooks were not triggered:");
+
+ if (unhit_hooks->len == 1)
+ {
+ hook = g_ptr_array_index (unhit_hooks, 0);
+ g_string_append_printf (msg, " '%s'", hook->pattern);
+ }
+ else
{
- hook = g_ptr_array_index (unhit_hooks, i);
+ for (i = 0; i < unhit_hooks->len; ++i)
+ {
+ hook = g_ptr_array_index (unhit_hooks, i);
- g_string_append_printf (msg, "\n\t'%s'", hook->pattern);
+ g_string_append_printf (msg, "\n\t'%s'", hook->pattern);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]