Update Changelog
[profile/ivi/libgee.git] / tests / testconcurrentlist.c
1 /* testconcurrentlist.c generated by valac 0.18.0, the Vala compiler
2  * generated from testconcurrentlist.vala, do not modify */
3
4 /* testconcurrentlist.vala
5  *
6  * Copyright (C) 2011  Maciej Piechotka
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12
13  * This library 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 GNU
16  * Lesser General Public License for more details.
17
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  *      Maciej Piechotka <uzytkownik2@gmail.com>
24  */
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <gee.h>
29 #include <stdlib.h>
30 #include <string.h>
31
32
33 #define GEE_TYPE_TEST_CASE (gee_test_case_get_type ())
34 #define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase))
35 #define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
36 #define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE))
37 #define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE))
38 #define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
39
40 typedef struct _GeeTestCase GeeTestCase;
41 typedef struct _GeeTestCaseClass GeeTestCaseClass;
42 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
43
44 #define TYPE_COLLECTION_TESTS (collection_tests_get_type ())
45 #define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests))
46 #define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass))
47 #define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS))
48 #define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS))
49 #define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass))
50
51 typedef struct _CollectionTests CollectionTests;
52 typedef struct _CollectionTestsClass CollectionTestsClass;
53 typedef struct _CollectionTestsPrivate CollectionTestsPrivate;
54
55 #define TYPE_LIST_TESTS (list_tests_get_type ())
56 #define LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIST_TESTS, ListTests))
57 #define LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIST_TESTS, ListTestsClass))
58 #define IS_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIST_TESTS))
59 #define IS_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIST_TESTS))
60 #define LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIST_TESTS, ListTestsClass))
61
62 typedef struct _ListTests ListTests;
63 typedef struct _ListTestsClass ListTestsClass;
64 typedef struct _ListTestsPrivate ListTestsPrivate;
65
66 #define TYPE_CONCURRENT_LIST_TESTS (concurrent_list_tests_get_type ())
67 #define CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTests))
68 #define CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass))
69 #define IS_CONCURRENT_LIST_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_LIST_TESTS))
70 #define IS_CONCURRENT_LIST_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_LIST_TESTS))
71 #define CONCURRENT_LIST_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_LIST_TESTS, ConcurrentListTestsClass))
72
73 typedef struct _ConcurrentListTests ConcurrentListTests;
74 typedef struct _ConcurrentListTestsClass ConcurrentListTestsClass;
75 typedef struct _ConcurrentListTestsPrivate ConcurrentListTestsPrivate;
76 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
77
78 struct _GeeTestCase {
79         GObject parent_instance;
80         GeeTestCasePrivate * priv;
81 };
82
83 struct _GeeTestCaseClass {
84         GObjectClass parent_class;
85         void (*set_up) (GeeTestCase* self);
86         void (*tear_down) (GeeTestCase* self);
87 };
88
89 struct _CollectionTests {
90         GeeTestCase parent_instance;
91         CollectionTestsPrivate * priv;
92         GeeCollection* test_collection;
93 };
94
95 struct _CollectionTestsClass {
96         GeeTestCaseClass parent_class;
97 };
98
99 struct _ListTests {
100         CollectionTests parent_instance;
101         ListTestsPrivate * priv;
102 };
103
104 struct _ListTestsClass {
105         CollectionTestsClass parent_class;
106         void (*test_duplicates_are_retained) (ListTests* self);
107 };
108
109 struct _ConcurrentListTests {
110         ListTests parent_instance;
111         ConcurrentListTestsPrivate * priv;
112 };
113
114 struct _ConcurrentListTestsClass {
115         ListTestsClass parent_class;
116 };
117
118
119 static gpointer concurrent_list_tests_parent_class = NULL;
120
121 GType gee_test_case_get_type (void) G_GNUC_CONST;
122 GType collection_tests_get_type (void) G_GNUC_CONST;
123 GType list_tests_get_type (void) G_GNUC_CONST;
124 GType concurrent_list_tests_get_type (void) G_GNUC_CONST;
125 enum  {
126         CONCURRENT_LIST_TESTS_DUMMY_PROPERTY
127 };
128 ConcurrentListTests* concurrent_list_tests_new (void);
129 ConcurrentListTests* concurrent_list_tests_construct (GType object_type);
130 ListTests* list_tests_construct (GType object_type, const gchar* name);
131 static void concurrent_list_tests_real_set_up (GeeTestCase* base);
132 static void concurrent_list_tests_real_tear_down (GeeTestCase* base);
133
134
135 ConcurrentListTests* concurrent_list_tests_construct (GType object_type) {
136         ConcurrentListTests * self = NULL;
137         self = (ConcurrentListTests*) list_tests_construct (object_type, "ConcurrentList");
138         return self;
139 }
140
141
142 ConcurrentListTests* concurrent_list_tests_new (void) {
143         return concurrent_list_tests_construct (TYPE_CONCURRENT_LIST_TESTS);
144 }
145
146
147 static void concurrent_list_tests_real_set_up (GeeTestCase* base) {
148         ConcurrentListTests * self;
149         GeeConcurrentList* _tmp0_;
150         self = (ConcurrentListTests*) base;
151         _tmp0_ = gee_concurrent_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
152         _g_object_unref0 (((CollectionTests*) self)->test_collection);
153         ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_;
154 }
155
156
157 static void concurrent_list_tests_real_tear_down (GeeTestCase* base) {
158         ConcurrentListTests * self;
159         self = (ConcurrentListTests*) base;
160         _g_object_unref0 (((CollectionTests*) self)->test_collection);
161         ((CollectionTests*) self)->test_collection = NULL;
162 }
163
164
165 static void concurrent_list_tests_class_init (ConcurrentListTestsClass * klass) {
166         concurrent_list_tests_parent_class = g_type_class_peek_parent (klass);
167         GEE_TEST_CASE_CLASS (klass)->set_up = concurrent_list_tests_real_set_up;
168         GEE_TEST_CASE_CLASS (klass)->tear_down = concurrent_list_tests_real_tear_down;
169 }
170
171
172 static void concurrent_list_tests_instance_init (ConcurrentListTests * self) {
173 }
174
175
176 GType concurrent_list_tests_get_type (void) {
177         static volatile gsize concurrent_list_tests_type_id__volatile = 0;
178         if (g_once_init_enter (&concurrent_list_tests_type_id__volatile)) {
179                 static const GTypeInfo g_define_type_info = { sizeof (ConcurrentListTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) concurrent_list_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConcurrentListTests), 0, (GInstanceInitFunc) concurrent_list_tests_instance_init, NULL };
180                 GType concurrent_list_tests_type_id;
181                 concurrent_list_tests_type_id = g_type_register_static (TYPE_LIST_TESTS, "ConcurrentListTests", &g_define_type_info, 0);
182                 g_once_init_leave (&concurrent_list_tests_type_id__volatile, concurrent_list_tests_type_id);
183         }
184         return concurrent_list_tests_type_id__volatile;
185 }
186
187
188