renderer-gst: Deprecate element wrapping
[profile/ivi/rygel.git] / tests / rygel-regression.vala
1 /*
2  * Copyright (C) 2012 Jens Georg <mail@jensge.org>
3  *
4  * Author: Jens Georg <mail@jensge.org>
5  *
6  * This file is part of Rygel.
7  *
8  * Rygel is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Rygel is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22
23 private class Rygel.Regression {
24     private MainLoop loop;
25
26     public static int main (string[] args) {
27         var test = new Regression ();
28
29         test.run ();
30
31         return 0;
32     }
33
34     public void run () {
35         this.loop = new MainLoop ();
36         test_661482.begin ();
37         loop.run ();
38     }
39
40     public async void test_661482 () {
41         var container = new SimpleContainer ("0", null, "0");
42         var item_1 = new ImageItem ("Z", container, "Z");
43         var item_2 = new ImageItem ("M", container, "M");
44         var item_3 = new ImageItem ("A", container, "A");
45
46         container.add_child_item (item_1);
47         container.add_child_item (item_2);
48         container.add_child_item (item_3);
49
50         try {
51             var list = yield container.get_children (0, 3, "+dc:title", null);
52             for (var i = 0; i < 3; ++i) {
53                 var children = yield container.get_children (i,
54                                                              1,
55                                                              "+dc:title",
56                                                              null);
57                 assert (children[0].title == list[i].title);
58             }
59
60         } catch (Error error) { assert_not_reached (); }
61
62         loop.quit ();
63     }
64 }