1 /* testconcurrentset.c generated by valac 0.18.0, the Vala compiler
2 * generated from testconcurrentset.vala, do not modify */
4 /* testconcurrentset.vala
6 * Copyright (C) 2012 Maciej Piechotka
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.
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.
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
23 * Maciej Piechotka <uzytkownik2@gmail.com>
27 #include <glib-object.h>
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))
40 typedef struct _GeeTestCase GeeTestCase;
41 typedef struct _GeeTestCaseClass GeeTestCaseClass;
42 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
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))
51 typedef struct _CollectionTests CollectionTests;
52 typedef struct _CollectionTestsClass CollectionTestsClass;
53 typedef struct _CollectionTestsPrivate CollectionTestsPrivate;
55 #define TYPE_SET_TESTS (set_tests_get_type ())
56 #define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests))
57 #define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass))
58 #define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS))
59 #define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS))
60 #define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass))
62 typedef struct _SetTests SetTests;
63 typedef struct _SetTestsClass SetTestsClass;
64 typedef struct _SetTestsPrivate SetTestsPrivate;
66 #define TYPE_SORTED_SET_TESTS (sorted_set_tests_get_type ())
67 #define SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_SET_TESTS, SortedSetTests))
68 #define SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))
69 #define IS_SORTED_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_SET_TESTS))
70 #define IS_SORTED_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_SET_TESTS))
71 #define SORTED_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_SET_TESTS, SortedSetTestsClass))
73 typedef struct _SortedSetTests SortedSetTests;
74 typedef struct _SortedSetTestsClass SortedSetTestsClass;
75 typedef struct _SortedSetTestsPrivate SortedSetTestsPrivate;
77 #define TYPE_CONCURRENT_SET_TESTS (concurrent_set_tests_get_type ())
78 #define CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTests))
79 #define CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass))
80 #define IS_CONCURRENT_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONCURRENT_SET_TESTS))
81 #define IS_CONCURRENT_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONCURRENT_SET_TESTS))
82 #define CONCURRENT_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONCURRENT_SET_TESTS, ConcurrentSetTestsClass))
84 typedef struct _ConcurrentSetTests ConcurrentSetTests;
85 typedef struct _ConcurrentSetTestsClass ConcurrentSetTestsClass;
86 typedef struct _ConcurrentSetTestsPrivate ConcurrentSetTestsPrivate;
87 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
90 GObject parent_instance;
91 GeeTestCasePrivate * priv;
94 struct _GeeTestCaseClass {
95 GObjectClass parent_class;
96 void (*set_up) (GeeTestCase* self);
97 void (*tear_down) (GeeTestCase* self);
100 struct _CollectionTests {
101 GeeTestCase parent_instance;
102 CollectionTestsPrivate * priv;
103 GeeCollection* test_collection;
106 struct _CollectionTestsClass {
107 GeeTestCaseClass parent_class;
111 CollectionTests parent_instance;
112 SetTestsPrivate * priv;
115 struct _SetTestsClass {
116 CollectionTestsClass parent_class;
117 void (*test_duplicates_are_ignored) (SetTests* self);
120 struct _SortedSetTests {
121 SetTests parent_instance;
122 SortedSetTestsPrivate * priv;
125 struct _SortedSetTestsClass {
126 SetTestsClass parent_class;
129 struct _ConcurrentSetTests {
130 SortedSetTests parent_instance;
131 ConcurrentSetTestsPrivate * priv;
134 struct _ConcurrentSetTestsClass {
135 SortedSetTestsClass parent_class;
139 static gpointer concurrent_set_tests_parent_class = NULL;
141 GType gee_test_case_get_type (void) G_GNUC_CONST;
142 GType collection_tests_get_type (void) G_GNUC_CONST;
143 GType set_tests_get_type (void) G_GNUC_CONST;
144 GType sorted_set_tests_get_type (void) G_GNUC_CONST;
145 GType concurrent_set_tests_get_type (void) G_GNUC_CONST;
147 CONCURRENT_SET_TESTS_DUMMY_PROPERTY
149 ConcurrentSetTests* concurrent_set_tests_new (void);
150 ConcurrentSetTests* concurrent_set_tests_construct (GType object_type);
151 SortedSetTests* sorted_set_tests_construct (GType object_type, const gchar* name, gboolean strict);
152 static void concurrent_set_tests_real_set_up (GeeTestCase* base);
153 static void concurrent_set_tests_real_tear_down (GeeTestCase* base);
156 ConcurrentSetTests* concurrent_set_tests_construct (GType object_type) {
157 ConcurrentSetTests * self = NULL;
158 self = (ConcurrentSetTests*) sorted_set_tests_construct (object_type, "ConcurrentSet", FALSE);
163 ConcurrentSetTests* concurrent_set_tests_new (void) {
164 return concurrent_set_tests_construct (TYPE_CONCURRENT_SET_TESTS);
168 static void concurrent_set_tests_real_set_up (GeeTestCase* base) {
169 ConcurrentSetTests * self;
170 GeeConcurrentSet* _tmp0_;
171 self = (ConcurrentSetTests*) base;
172 _tmp0_ = gee_concurrent_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
173 _g_object_unref0 (((CollectionTests*) self)->test_collection);
174 ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_;
178 static void concurrent_set_tests_real_tear_down (GeeTestCase* base) {
179 ConcurrentSetTests * self;
180 self = (ConcurrentSetTests*) base;
181 _g_object_unref0 (((CollectionTests*) self)->test_collection);
182 ((CollectionTests*) self)->test_collection = NULL;
186 static void concurrent_set_tests_class_init (ConcurrentSetTestsClass * klass) {
187 concurrent_set_tests_parent_class = g_type_class_peek_parent (klass);
188 GEE_TEST_CASE_CLASS (klass)->set_up = concurrent_set_tests_real_set_up;
189 GEE_TEST_CASE_CLASS (klass)->tear_down = concurrent_set_tests_real_tear_down;
193 static void concurrent_set_tests_instance_init (ConcurrentSetTests * self) {
197 GType concurrent_set_tests_get_type (void) {
198 static volatile gsize concurrent_set_tests_type_id__volatile = 0;
199 if (g_once_init_enter (&concurrent_set_tests_type_id__volatile)) {
200 static const GTypeInfo g_define_type_info = { sizeof (ConcurrentSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) concurrent_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConcurrentSetTests), 0, (GInstanceInitFunc) concurrent_set_tests_instance_init, NULL };
201 GType concurrent_set_tests_type_id;
202 concurrent_set_tests_type_id = g_type_register_static (TYPE_SORTED_SET_TESTS, "ConcurrentSetTests", &g_define_type_info, 0);
203 g_once_init_leave (&concurrent_set_tests_type_id__volatile, concurrent_set_tests_type_id);
205 return concurrent_set_tests_type_id__volatile;