return hb_blob_create (data, sizeof (data), HB_MEMORY_MODE_READONLY, NULL, NULL);
}
static void *
-create_blob_inert (void)
+create_blob_from_inert (void)
{
return hb_blob_create (NULL, 0, HB_MEMORY_MODE_DUPLICATE, NULL, NULL);
}
return hb_buffer_create ();
}
static void *
-create_buffer_inert (void)
+create_buffer_from_inert (void)
{
return NULL;
}
return hb_set_create ();
}
static void *
-create_set_inert (void)
+create_set_from_inert (void)
{
return NULL;
}
return face;
}
static void *
-create_face_inert (void)
+create_face_from_inert (void)
{
return hb_face_create (hb_blob_get_empty (), 0);
}
return font;
}
static void *
-create_font_inert (void)
+create_font_from_inert (void)
{
return hb_font_create (hb_face_get_empty ());
}
return hb_font_funcs_create ();
}
static void *
-create_font_funcs_inert (void)
+create_font_funcs_from_inert (void)
{
return NULL;
}
return hb_unicode_funcs_create (NULL);
}
static void *
-create_unicode_funcs_inert (void)
+create_unicode_funcs_from_inert (void)
{
- return hb_unicode_funcs_get_default ();
+ return hb_unicode_funcs_create (hb_unicode_funcs_get_empty ());
}
typedef struct {
create_func_t create;
- create_func_t create_inert;
+ create_func_t create_from_inert;
create_func_t get_empty;
reference_func_t reference;
destroy_func_t destroy;
#define OBJECT_WITHOUT_IMMUTABILITY(name) \
{ \
(create_func_t) create_##name, \
- (create_func_t) create_##name##_inert, \
+ (create_func_t) create_##name##_from_inert, \
(create_func_t) hb_##name##_get_empty, \
(reference_func_t) hb_##name##_reference, \
(destroy_func_t) hb_##name##_destroy, \
#define OBJECT_WITH_IMMUTABILITY(name) \
{ \
(create_func_t) create_##name, \
- (create_func_t) create_##name##_inert, \
+ (create_func_t) create_##name##_from_inert, \
(create_func_t) hb_##name##_get_empty, \
(reference_func_t) hb_##name##_reference, \
(destroy_func_t) hb_##name##_destroy, \
{
data_t data[2] = {{MAGIC0, FALSE}, {MAGIC1, FALSE}};
- g_test_message ("->create_inert()");
- obj = o->create_inert ();
+ g_test_message ("->create_from_inert()");
+ obj = o->create_from_inert ();
if (!obj)
continue;
if (obj == o->get_empty ())
o->destroy (obj);
if (o->is_immutable)
- g_assert (o->is_immutable (obj));
+ g_assert (!o->is_immutable (obj));
- g_assert (!o->set_user_data (obj, &key[0], &data[0], free_up0, TRUE));
- g_assert (!o->get_user_data (obj, &key[0]));
+ g_assert (o->set_user_data (obj, &key[0], &data[0], free_up0, TRUE));
+ g_assert (o->get_user_data (obj, &key[0]));
o->destroy (obj);
- o->destroy (obj);
- o->destroy (obj);
- o->destroy (obj);
- o->destroy (obj);
- g_assert (!data[0].freed);
+ g_assert (data[0].freed);
}
}
}