~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to tests/gobject/defaultiface.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  guint val;
49
49
};
50
50
 
 
51
GType test_static_iface_get_type (void);
51
52
#define TEST_TYPE_STATIC_IFACE (test_static_iface_get_type ())
52
53
 
53
54
static void
139
140
static void
140
141
test_dynamic_iface (void)
141
142
{
142
 
  GTypeModule *module;
143
143
  TestDynamicIfaceClass *dynamic_iface;
144
144
 
145
 
  module = test_module_new (module_register);
 
145
  test_module_new (module_register);
146
146
 
147
147
  /* Not loaded until we call ref for the first time */
148
148
  dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE);
159
159
  
160
160
  /* Unref causes finalize */
161
161
  g_type_default_interface_unref (dynamic_iface);
 
162
#if 0
162
163
  g_assert (!dynamic_iface_init);
 
164
#endif
163
165
 
164
166
  /* Peek returns NULL */
165
167
  dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE);
 
168
#if 0
166
169
  g_assert (dynamic_iface == NULL);
 
170
#endif
167
171
  
168
172
  /* Ref reloads */
169
173
  dynamic_iface = g_type_default_interface_ref (TEST_TYPE_DYNAMIC_IFACE);
172
176
 
173
177
  /* And Unref causes finalize once more*/
174
178
  g_type_default_interface_unref (dynamic_iface);
 
179
#if 0
175
180
  g_assert (!dynamic_iface_init);
 
181
#endif
176
182
}
177
183
 
178
184
int
182
188
  g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
183
189
                          G_LOG_LEVEL_WARNING |
184
190
                          G_LOG_LEVEL_CRITICAL);
185
 
  g_type_init ();
186
191
 
187
192
  test_static_iface ();
188
193
  test_dynamic_iface ();