Merge lp:~aacid/unity-greeter/test_make_layout_list_minifix into lp:unity-greeter

Proposed by Albert Astals Cid
Status: Merged
Merged at revision: 551
Proposed branch: lp:~aacid/unity-greeter/test_make_layout_list_minifix
Merge into: lp:unity-greeter
Diff against target: 30 lines (+10/-7)
1 file modified
src/user-list.vala (+10/-7)
To merge this branch: bzr merge lp:~aacid/unity-greeter/test_make_layout_list_minifix
Reviewer Review Type Date Requested Status
Unity Greeter Development Team Pending
Review via email: mp+122064@code.launchpad.net

Description of the change

Make test_make_layout_list account for null strings which we are actually passing

This doesn't matter in the running code, but for tests (glib test, it asserts and makes the test fail)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/user-list.vala'
2--- src/user-list.vala 2012-08-28 13:38:05 +0000
3+++ src/user-list.vala 2012-08-30 13:20:36 +0000
4@@ -1245,16 +1245,19 @@
5 return true;
6 }
7
8- private List <LightDM.Layout> test_make_layout_list (string names)
9+ private List <LightDM.Layout> test_make_layout_list (string? names)
10 {
11- var names_split = names.split (";");
12-
13 var layouts = new List <LightDM.Layout> ();
14- foreach (var name in names_split)
15+
16+ if (names != null)
17 {
18- var layout = UnityGreeter.get_layout_by_name (name);
19- if (layout != null)
20- layouts.append (layout);
21+ var names_split = names.split (";");
22+ foreach (var name in names_split)
23+ {
24+ var layout = UnityGreeter.get_layout_by_name (name);
25+ if (layout != null)
26+ layouts.append (layout);
27+ }
28 }
29
30 return layouts;

Subscribers

People subscribed via source and target branches