1 /* testhashset.c generated by valac 0.18.0, the Vala compiler
2 * generated from testhashset.vala, do not modify */
6 * Copyright (C) 2009 Didier Villevalois, Julien Peeters
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 * Didier 'Ptitjes' Villevalois <ptitjes@free.fr>
24 * Julien Peeters <contact@julienpeeters.fr>
28 #include <glib-object.h>
34 #define GEE_TYPE_TEST_CASE (gee_test_case_get_type ())
35 #define GEE_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_TYPE_TEST_CASE, GeeTestCase))
36 #define GEE_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
37 #define GEE_IS_TEST_CASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_TYPE_TEST_CASE))
38 #define GEE_IS_TEST_CASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_TYPE_TEST_CASE))
39 #define GEE_TEST_CASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_TYPE_TEST_CASE, GeeTestCaseClass))
41 typedef struct _GeeTestCase GeeTestCase;
42 typedef struct _GeeTestCaseClass GeeTestCaseClass;
43 typedef struct _GeeTestCasePrivate GeeTestCasePrivate;
45 #define TYPE_COLLECTION_TESTS (collection_tests_get_type ())
46 #define COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_TESTS, CollectionTests))
47 #define COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_TESTS, CollectionTestsClass))
48 #define IS_COLLECTION_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_TESTS))
49 #define IS_COLLECTION_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_TESTS))
50 #define COLLECTION_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_TESTS, CollectionTestsClass))
52 typedef struct _CollectionTests CollectionTests;
53 typedef struct _CollectionTestsClass CollectionTestsClass;
54 typedef struct _CollectionTestsPrivate CollectionTestsPrivate;
56 #define TYPE_SET_TESTS (set_tests_get_type ())
57 #define SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_TESTS, SetTests))
58 #define SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_TESTS, SetTestsClass))
59 #define IS_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_TESTS))
60 #define IS_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_TESTS))
61 #define SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_TESTS, SetTestsClass))
63 typedef struct _SetTests SetTests;
64 typedef struct _SetTestsClass SetTestsClass;
65 typedef struct _SetTestsPrivate SetTestsPrivate;
67 #define TYPE_HASH_SET_TESTS (hash_set_tests_get_type ())
68 #define HASH_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HASH_SET_TESTS, HashSetTests))
69 #define HASH_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HASH_SET_TESTS, HashSetTestsClass))
70 #define IS_HASH_SET_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HASH_SET_TESTS))
71 #define IS_HASH_SET_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HASH_SET_TESTS))
72 #define HASH_SET_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HASH_SET_TESTS, HashSetTestsClass))
74 typedef struct _HashSetTests HashSetTests;
75 typedef struct _HashSetTestsClass HashSetTestsClass;
76 typedef struct _HashSetTestsPrivate HashSetTestsPrivate;
77 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
80 GObject parent_instance;
81 GeeTestCasePrivate * priv;
84 struct _GeeTestCaseClass {
85 GObjectClass parent_class;
86 void (*set_up) (GeeTestCase* self);
87 void (*tear_down) (GeeTestCase* self);
90 struct _CollectionTests {
91 GeeTestCase parent_instance;
92 CollectionTestsPrivate * priv;
93 GeeCollection* test_collection;
96 struct _CollectionTestsClass {
97 GeeTestCaseClass parent_class;
101 CollectionTests parent_instance;
102 SetTestsPrivate * priv;
105 struct _SetTestsClass {
106 CollectionTestsClass parent_class;
107 void (*test_duplicates_are_ignored) (SetTests* self);
110 struct _HashSetTests {
111 SetTests parent_instance;
112 HashSetTestsPrivate * priv;
115 struct _HashSetTestsClass {
116 SetTestsClass parent_class;
120 static gpointer hash_set_tests_parent_class = NULL;
122 GType gee_test_case_get_type (void) G_GNUC_CONST;
123 GType collection_tests_get_type (void) G_GNUC_CONST;
124 GType set_tests_get_type (void) G_GNUC_CONST;
125 GType hash_set_tests_get_type (void) G_GNUC_CONST;
127 HASH_SET_TESTS_DUMMY_PROPERTY
129 HashSetTests* hash_set_tests_new (void);
130 HashSetTests* hash_set_tests_construct (GType object_type);
131 SetTests* set_tests_construct (GType object_type, const gchar* name);
132 static void hash_set_tests_real_set_up (GeeTestCase* base);
133 static void hash_set_tests_real_tear_down (GeeTestCase* base);
136 HashSetTests* hash_set_tests_construct (GType object_type) {
137 HashSetTests * self = NULL;
138 self = (HashSetTests*) set_tests_construct (object_type, "HashSet");
143 HashSetTests* hash_set_tests_new (void) {
144 return hash_set_tests_construct (TYPE_HASH_SET_TESTS);
148 static void hash_set_tests_real_set_up (GeeTestCase* base) {
151 self = (HashSetTests*) base;
152 _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
153 _g_object_unref0 (((CollectionTests*) self)->test_collection);
154 ((CollectionTests*) self)->test_collection = (GeeCollection*) _tmp0_;
158 static void hash_set_tests_real_tear_down (GeeTestCase* base) {
160 self = (HashSetTests*) base;
161 _g_object_unref0 (((CollectionTests*) self)->test_collection);
162 ((CollectionTests*) self)->test_collection = NULL;
166 static void hash_set_tests_class_init (HashSetTestsClass * klass) {
167 hash_set_tests_parent_class = g_type_class_peek_parent (klass);
168 GEE_TEST_CASE_CLASS (klass)->set_up = hash_set_tests_real_set_up;
169 GEE_TEST_CASE_CLASS (klass)->tear_down = hash_set_tests_real_tear_down;
173 static void hash_set_tests_instance_init (HashSetTests * self) {
177 GType hash_set_tests_get_type (void) {
178 static volatile gsize hash_set_tests_type_id__volatile = 0;
179 if (g_once_init_enter (&hash_set_tests_type_id__volatile)) {
180 static const GTypeInfo g_define_type_info = { sizeof (HashSetTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hash_set_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HashSetTests), 0, (GInstanceInitFunc) hash_set_tests_instance_init, NULL };
181 GType hash_set_tests_type_id;
182 hash_set_tests_type_id = g_type_register_static (TYPE_SET_TESTS, "HashSetTests", &g_define_type_info, 0);
183 g_once_init_leave (&hash_set_tests_type_id__volatile, hash_set_tests_type_id);
185 return hash_set_tests_type_id__volatile;