Merge lp:~larsu/indicator-messages/dont-warn-in-tests into lp:indicator-messages/14.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Charles Kerr
Approved revision: 399
Merged at revision: 398
Proposed branch: lp:~larsu/indicator-messages/dont-warn-in-tests
Merge into: lp:indicator-messages/14.04
Diff against target: 57 lines (+21/-1)
2 files modified
src/gactionmuxer.c (+4/-1)
test/test-gactionmuxer.cpp (+17/-0)
To merge this branch: bzr merge lp:~larsu/indicator-messages/dont-warn-in-tests
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+195980@code.launchpad.net

Description of the change

Stop showing expected warnings in the actionmuxer test

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gactionmuxer.c'
2--- src/gactionmuxer.c 2013-08-20 10:38:10 +0000
3+++ src/gactionmuxer.c 2013-11-20 16:12:33 +0000
4@@ -429,10 +429,13 @@
5 gchar **action;
6
7 g_return_if_fail (G_IS_ACTION_MUXER (muxer));
8- g_return_if_fail (G_IS_ACTION_GROUP (group));
9+ g_return_if_fail (group == NULL || G_IS_ACTION_GROUP (group));
10
11 g_action_muxer_remove (muxer, prefix);
12
13+ if (group == NULL)
14+ return;
15+
16 if (prefix)
17 {
18 prefix_copy = g_strdup (prefix);
19
20=== modified file 'test/test-gactionmuxer.cpp'
21--- test/test-gactionmuxer.cpp 2013-08-28 10:23:31 +0000
22+++ test/test-gactionmuxer.cpp 2013-11-20 16:12:33 +0000
23@@ -46,17 +46,34 @@
24 g_type_init ();
25 #endif
26
27+ g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*");
28 g_action_muxer_insert (NULL, NULL, NULL);
29+ g_test_assert_expected_messages ();
30+
31+ g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*");
32 g_action_muxer_remove (NULL, NULL);
33+ g_test_assert_expected_messages ();
34
35 muxer = g_action_muxer_new ();
36
37 g_action_muxer_insert (muxer, NULL, NULL);
38 g_action_muxer_remove (muxer, NULL);
39+
40+ g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*");
41 EXPECT_FALSE (g_action_group_has_action (G_ACTION_GROUP (muxer), NULL));
42+ g_test_assert_expected_messages ();
43+
44+ g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*");
45 EXPECT_FALSE (g_action_group_get_action_enabled (G_ACTION_GROUP (muxer), NULL));
46+ g_test_assert_expected_messages ();
47+
48+ g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*");
49 EXPECT_FALSE (g_action_group_query_action (G_ACTION_GROUP (muxer), NULL, NULL, NULL, NULL, NULL, NULL));
50+ g_test_assert_expected_messages ();
51+
52+ g_test_expect_message ("GLib-GIO", G_LOG_LEVEL_CRITICAL, "*NULL*");
53 g_action_group_activate_action (G_ACTION_GROUP (muxer), NULL, NULL);
54+ g_test_assert_expected_messages ();
55
56 g_object_unref (muxer);
57 }

Subscribers

People subscribed via source and target branches