1 /* testhashmap.c generated by valac 0.18.0, the Vala compiler
2 * generated from testhashmap.vala, do not modify */
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 * 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_MAP_TESTS (map_tests_get_type ())
46 #define MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_TESTS, MapTests))
47 #define MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_TESTS, MapTestsClass))
48 #define IS_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_TESTS))
49 #define IS_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_TESTS))
50 #define MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_TESTS, MapTestsClass))
52 typedef struct _MapTests MapTests;
53 typedef struct _MapTestsClass MapTestsClass;
54 typedef struct _MapTestsPrivate MapTestsPrivate;
56 #define TYPE_HASH_MAP_TESTS (hash_map_tests_get_type ())
57 #define HASH_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HASH_MAP_TESTS, HashMapTests))
58 #define HASH_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HASH_MAP_TESTS, HashMapTestsClass))
59 #define IS_HASH_MAP_TESTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HASH_MAP_TESTS))
60 #define IS_HASH_MAP_TESTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HASH_MAP_TESTS))
61 #define HASH_MAP_TESTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HASH_MAP_TESTS, HashMapTestsClass))
63 typedef struct _HashMapTests HashMapTests;
64 typedef struct _HashMapTestsClass HashMapTestsClass;
65 typedef struct _HashMapTestsPrivate HashMapTestsPrivate;
66 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
69 GObject parent_instance;
70 GeeTestCasePrivate * priv;
73 struct _GeeTestCaseClass {
74 GObjectClass parent_class;
75 void (*set_up) (GeeTestCase* self);
76 void (*tear_down) (GeeTestCase* self);
80 GeeTestCase parent_instance;
81 MapTestsPrivate * priv;
85 struct _MapTestsClass {
86 GeeTestCaseClass parent_class;
89 struct _HashMapTests {
90 MapTests parent_instance;
91 HashMapTestsPrivate * priv;
94 struct _HashMapTestsClass {
95 MapTestsClass parent_class;
99 static gpointer hash_map_tests_parent_class = NULL;
101 GType gee_test_case_get_type (void) G_GNUC_CONST;
102 GType map_tests_get_type (void) G_GNUC_CONST;
103 GType hash_map_tests_get_type (void) G_GNUC_CONST;
105 HASH_MAP_TESTS_DUMMY_PROPERTY
107 HashMapTests* hash_map_tests_new (void);
108 HashMapTests* hash_map_tests_construct (GType object_type);
109 MapTests* map_tests_construct (GType object_type, const gchar* name);
110 static void hash_map_tests_real_set_up (GeeTestCase* base);
111 static void hash_map_tests_real_tear_down (GeeTestCase* base);
114 HashMapTests* hash_map_tests_construct (GType object_type) {
115 HashMapTests * self = NULL;
116 self = (HashMapTests*) map_tests_construct (object_type, "HashMap");
121 HashMapTests* hash_map_tests_new (void) {
122 return hash_map_tests_construct (TYPE_HASH_MAP_TESTS);
126 static void hash_map_tests_real_set_up (GeeTestCase* base) {
129 self = (HashMapTests*) base;
130 _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
131 _g_object_unref0 (((MapTests*) self)->test_map);
132 ((MapTests*) self)->test_map = (GeeMap*) _tmp0_;
136 static void hash_map_tests_real_tear_down (GeeTestCase* base) {
138 self = (HashMapTests*) base;
139 _g_object_unref0 (((MapTests*) self)->test_map);
140 ((MapTests*) self)->test_map = NULL;
144 static void hash_map_tests_class_init (HashMapTestsClass * klass) {
145 hash_map_tests_parent_class = g_type_class_peek_parent (klass);
146 GEE_TEST_CASE_CLASS (klass)->set_up = hash_map_tests_real_set_up;
147 GEE_TEST_CASE_CLASS (klass)->tear_down = hash_map_tests_real_tear_down;
151 static void hash_map_tests_instance_init (HashMapTests * self) {
155 GType hash_map_tests_get_type (void) {
156 static volatile gsize hash_map_tests_type_id__volatile = 0;
157 if (g_once_init_enter (&hash_map_tests_type_id__volatile)) {
158 static const GTypeInfo g_define_type_info = { sizeof (HashMapTestsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) hash_map_tests_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (HashMapTests), 0, (GInstanceInitFunc) hash_map_tests_instance_init, NULL };
159 GType hash_map_tests_type_id;
160 hash_map_tests_type_id = g_type_register_static (TYPE_MAP_TESTS, "HashMapTests", &g_define_type_info, 0);
161 g_once_init_leave (&hash_map_tests_type_id__volatile, hash_map_tests_type_id);
163 return hash_map_tests_type_id__volatile;