Merge lp:~smspillaz/unity/unity.fix_1086762 into lp:unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2962
Proposed branch: lp:~smspillaz/unity/unity.fix_1086762
Merge into: lp:unity
Diff against target: 38 lines (+6/-2)
1 file modified
tests/test_panel_style.cpp (+6/-2)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_1086762
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+138118@code.launchpad.net

Commit message

Use g_setenv and g_unsetenv and change the font setting back

Description of the change

Use g_setenv and g_unsetenv and change the font setting back.

Technically setting GSETTINGS_BACKEND=memory should fix this, but it doesn't. No idea why, so at the moment lets just not leave the font in an inconsistent state.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Fine, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test_panel_style.cpp'
2--- tests/test_panel_style.cpp 2012-08-01 17:33:50 +0000
3+++ tests/test_panel_style.cpp 2012-12-05 12:11:23 +0000
4@@ -43,7 +43,7 @@
5
6 /* override */ void SetUp()
7 {
8- g_setenv("GSETTINGS_BACKEND", "memory", TRUE);
9+ g_setenv ("GSETTINGS_BACKEND", "memory", 1);
10
11 gsettings = g_settings_new("org.gnome.desktop.wm.preferences");
12 g_settings_set_string(gsettings, "titlebar-font", TITLEBAR_FONT.c_str());
13@@ -53,7 +53,7 @@
14
15 /* override */ void TearDown()
16 {
17- g_setenv("GSETTINGS_BACKEND", "", TRUE);
18+ g_unsetenv ("GSETTINGS_BACKEND");
19 }
20 };
21
22@@ -70,12 +70,16 @@
23 signal_received = true;
24 });
25
26+ gchar *old_font = g_settings_get_string(gsettings, "titlebar-font");
27 g_settings_set_string(gsettings, "titlebar-font", "Ubuntu Italic 11");
28
29 sleep(1);
30
31 ASSERT_TRUE(signal_received);
32 ASSERT_EQ(panel_style_instance->GetFontDescription(panel::PanelItem::TITLE), "Ubuntu Italic 11");
33+
34+ g_settings_set_string(gsettings, "titlebar-font", old_font);
35+ g_free (old_font);
36 }
37
38 }