1 /* testhashmultiset.c generated by valac 0.18.0, the Vala compiler
2 * generated from testhashmultiset.vala, do not modify */
4 /* testhashmultiset.vala
6 * Copyright (C) 2008 Jürg Billeter
7 * Copyright (C) 2009 Didier Villevalois, Julien Peeters
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 * Jürg Billeter <j@bitron.ch>
25 * Didier 'Ptitjes Villevalois <ptitjes@free.fr>
26 * Julien Peeters <contact@julienpeeters.fr>
30 #include <glib-object.h>
36 #define GEE_TYPE_TEST_CASE (gee_test_case_get_type ())
37 #define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase))
38 #define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
39 #define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE))
40 #define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE))
41 #define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
43 typedef struct _GeeTestCase GeeTestCase;
44 typedef struct _GeeTestCaseClass GeeTestCaseClass;
45 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
47 #define TYPE_COLLECTION_TESTS (collection_tests_get_type ())
48 #define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests))
49 #define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass))
50 #define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS))
51 #define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS))
52 #define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass))
54 typedef struct _CollectionTests CollectionTests;
55 typedef struct _CollectionTestsClass CollectionTestsClass;
56 typedef struct _CollectionTestsPrivate CollectionTestsPrivate;
58 #define TYPE_MULTI_SET_TESTS (multi_set_tests_get_type ())
59 #define MULTI_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MULTI_SET_TESTS, MultiSetTests))
60 #define MULTI_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MULTI_SET_TESTS, MultiSetTestsClass))
61 #define IS_MULTI_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MULTI_SET_TESTS))
62 #define IS_MULTI_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MULTI_SET_TESTS))
63 #define MULTI_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MULTI_SET_TESTS, MultiSetTestsClass))
65 typedef struct _MultiSetTests MultiSetTests;
66 typedef struct _MultiSetTestsClass MultiSetTestsClass;
67 typedef struct _MultiSetTestsPrivate MultiSetTestsPrivate;
69 #define TYPE_HASH_MULTI_SET_TESTS (hash_multi_set_tests_get_type ())
70 #define HASH_MULTI_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HASH_MULTI_SET_TESTS, HashMultiSetTests))
71 #define HASH_MULTI_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HASH_MULTI_SET_TESTS, HashMultiSetTestsClass))
72 #define IS_HASH_MULTI_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HASH_MULTI_SET_TESTS))
73 #define IS_HASH_MULTI_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HASH_MULTI_SET_TESTS))
74 #define HASH_MULTI_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HASH_MULTI_SET_TESTS, HashMultiSetTestsClass))
76 typedef struct _HashMultiSetTests HashMultiSetTests;
77 typedef struct _HashMultiSetTestsClass HashMultiSetTestsClass;
78 typedef struct _HashMultiSetTestsPrivate HashMultiSetTestsPrivate;
79 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
80 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
83 GObject parent_instance;
84 GeeTestCasePrivate * priv;
87 struct _GeeTestCaseClass {
88 GObjectClass parent_class;
89 void (*set_up) (GeeTestCase* self);
90 void (*tear_down) (GeeTestCase* self);
93 struct _CollectionTests {
94 GeeTestCase parent_instance;
95 CollectionTestsPrivate * priv;
96 GeeCollection* test_collection;
99 struct _CollectionTestsClass {
100 GeeTestCaseClass parent_class;
103 struct _MultiSetTests {
104 CollectionTests parent_instance;
105 MultiSetTestsPrivate * priv;
108 struct _MultiSetTestsClass {
109 CollectionTestsClass parent_class;
112 struct _HashMultiSetTests {
113 MultiSetTests parent_instance;
114 HashMultiSetTestsPrivate * priv;
117 struct _HashMultiSetTestsClass {
118 MultiSetTestsClass parent_class;
121 typedef void (*GeeTestCaseTestMethod) (void* user_data);
123 static gpointer hash_multi_set_tests_parent_class = NULL;
125 GType gee_test_case_get_type (void) G_GNUC_CONST;
126 GType collection_tests_get_type (void) G_GNUC_CONST;
127 GType multi_set_tests_get_type (void) G_GNUC_CONST;
128 GType hash_multi_set_tests_get_type (void) G_GNUC_CONST;
130 HASH_MULTI_SET_TESTS_DUMMY_PROPERTY
132 HashMultiSetTests* hash_multi_set_tests_new (void);
133 HashMultiSetTests* hash_multi_set_tests_construct (GType object_type);
134 MultiSetTests* multi_set_tests_construct (GType object_type, const gchar* name);
135 void gee_test_case_add_test (GeeTestCase* self, const gchar* name, GeeTestCaseTestMethod test, void* test_target, GDestroyNotify test_target_destroy_notify);
136 static void hash_multi_set_tests_test_selected_functions (HashMultiSetTests* self);
137 static void _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self);
138 static void hash_multi_set_tests_real_set_up (GeeTestCase* base);
139 static void hash_multi_set_tests_real_tear_down (GeeTestCase* base);
142 static void _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method (gpointer self) {
143 hash_multi_set_tests_test_selected_functions (self);
147 HashMultiSetTests* hash_multi_set_tests_construct (GType object_type) {
148 HashMultiSetTests * self = NULL;
149 self = (HashMultiSetTests*) multi_set_tests_construct (object_type, "HashMultiSet");
150 gee_test_case_add_test ((GeeTestCase*) self, "[HashMultiSet] selected functions", _hash_multi_set_tests_test_selected_functions_gee_test_case_test_method, g_object_ref (self), g_object_unref);
155 HashMultiSetTests* hash_multi_set_tests_new (void) {
156 return hash_multi_set_tests_construct (TYPE_HASH_MULTI_SET_TESTS);
160 static void hash_multi_set_tests_real_set_up (GeeTestCase* base) {
161 HashMultiSetTests * self;
162 GeeHashMultiSet* _tmp0_;
163 self = (HashMultiSetTests*) base;
164 _tmp0_ = gee_hash_multi_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL);
165 _g_object_unref0 (((CollectionTests*) self)->test_collection);
166 ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_;
170 static void hash_multi_set_tests_real_tear_down (GeeTestCase* base) {
171 HashMultiSetTests * self;
172 self = (HashMultiSetTests*) base;
173 _g_object_unref0 (((CollectionTests*) self)->test_collection);
174 ((CollectionTests*) self)->test_collection = NULL;
178 static gpointer _g_object_ref0 (gpointer self) {
179 return self ? g_object_ref (self) : NULL;
183 static void hash_multi_set_tests_test_selected_functions (HashMultiSetTests* self) {
184 GeeCollection* _tmp0_;
185 GeeHashMultiSet* _tmp1_;
186 GeeHashMultiSet* test_multi_set;
187 g_return_if_fail (self != NULL);
188 _tmp0_ = ((CollectionTests*) self)->test_collection;
189 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GEE_TYPE_HASH_MULTI_SET) ? ((GeeHashMultiSet*) _tmp0_) : NULL);
190 test_multi_set = _tmp1_;
191 _vala_assert (test_multi_set != NULL, "test_multi_set != null");
192 _g_object_unref0 (test_multi_set);
196 static void hash_multi_set_tests_class_init (HashMultiSetTestsClass * klass) {
197 hash_multi_set_tests_parent_class = g_type_class_peek_parent (klass);
198 GEE_TEST_CASE_CLASS (klass)->set_up = hash_multi_set_tests_real_set_up;
199 GEE_TEST_CASE_CLASS (klass)->tear_down = hash_multi_set_tests_real_tear_down;
203 static void hash_multi_set_tests_instance_init (HashMultiSetTests * self) {
207 GType hash_multi_set_tests_get_type (void) {
208 static volatile gsize hash_multi_set_tests_type_id__volatile = 0;
209 if (g_once_init_enter (&hash_multi_set_tests_type_id__volatile)) {
210 static const GTypeInfo g_define_type_info = { sizeof (HashMultiSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hash_multi_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HashMultiSetTests), 0, (GInstanceInitFunc) hash_multi_set_tests_instance_init, NULL };
211 GType hash_multi_set_tests_type_id;
212 hash_multi_set_tests_type_id = g_type_register_static (TYPE_MULTI_SET_TESTS, "HashMultiSetTests", &g_define_type_info, 0);
213 g_once_init_leave (&hash_multi_set_tests_type_id__volatile, hash_multi_set_tests_type_id);
215 return hash_multi_set_tests_type_id__volatile;