summaryrefslogtreecommitdiff
path: root/tests/testing-util
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2015-09-21 22:10:33 -0700
committerGarrett Regier <garrettregier@gmail.com>2015-09-22 01:04:38 -0700
commit3900941734f16ea1c9f6b22768d79bfa6ba7889b (patch)
tree99f540452a8a9d26a98a1f8e99058607e737990c /tests/testing-util
parentb410af079ad2bbb41f6c070d760d9608878b41ca (diff)
downloadlibpeas-3900941734f16ea1c9f6b22768d79bfa6ba7889b.tar.gz
Simplify test hook pop message generation
Diffstat (limited to 'tests/testing-util')
-rw-r--r--tests/testing-util/testing-util.c24
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);
+ }
}
}