mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 00:32:59 +00:00
[test-object] Hopefully last ubsan fix
API change: - hb_face_is_immutable() now takes `hb_face_t *` instead of previous `const hb_face_t *`. This should not pose any problem for any clients in our belief.
This commit is contained in:
parent
b99382e292
commit
a3d626b4b9
3 changed files with 31 additions and 31 deletions
|
@ -672,7 +672,7 @@ hb_face_make_immutable (hb_face_t *face)
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
hb_bool_t
|
||||
hb_face_is_immutable (const hb_face_t *face)
|
||||
hb_face_is_immutable (hb_face_t *face)
|
||||
{
|
||||
return hb_object_is_immutable (face);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ HB_EXTERN void
|
|||
hb_face_make_immutable (hb_face_t *face);
|
||||
|
||||
HB_EXTERN hb_bool_t
|
||||
hb_face_is_immutable (const hb_face_t *face);
|
||||
hb_face_is_immutable (hb_face_t *face);
|
||||
|
||||
|
||||
HB_EXTERN hb_blob_t *
|
||||
|
|
|
@ -29,52 +29,52 @@
|
|||
/* Unit tests for hb-object-private.h */
|
||||
|
||||
|
||||
static void *
|
||||
static hb_blob_t *
|
||||
create_blob (void)
|
||||
{
|
||||
static char data[] = "test data";
|
||||
return hb_blob_create (data, sizeof (data), HB_MEMORY_MODE_READONLY, NULL, NULL);
|
||||
}
|
||||
static void *
|
||||
static hb_blob_t *
|
||||
create_blob_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_buffer_t *
|
||||
create_buffer (void)
|
||||
{
|
||||
return hb_buffer_create ();
|
||||
}
|
||||
static void *
|
||||
static hb_buffer_t *
|
||||
create_buffer_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_map_t *
|
||||
create_map (void)
|
||||
{
|
||||
return hb_map_create ();
|
||||
}
|
||||
static void *
|
||||
static hb_map_t *
|
||||
create_map_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_set_t *
|
||||
create_set (void)
|
||||
{
|
||||
return hb_set_create ();
|
||||
}
|
||||
static void *
|
||||
static hb_set_t *
|
||||
create_set_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_face_t *
|
||||
create_face (void)
|
||||
{
|
||||
hb_blob_t *blob = (hb_blob_t *) create_blob ();
|
||||
|
@ -82,13 +82,13 @@ create_face (void)
|
|||
hb_blob_destroy (blob);
|
||||
return face;
|
||||
}
|
||||
static void *
|
||||
static hb_face_t *
|
||||
create_face_from_inert (void)
|
||||
{
|
||||
return hb_face_create (hb_blob_get_empty (), 0);
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_font_t *
|
||||
create_font (void)
|
||||
{
|
||||
hb_face_t *face = (hb_face_t *) create_face ();
|
||||
|
@ -96,24 +96,24 @@ create_font (void)
|
|||
hb_face_destroy (face);
|
||||
return font;
|
||||
}
|
||||
static void *
|
||||
static hb_font_t *
|
||||
create_font_from_inert (void)
|
||||
{
|
||||
return hb_font_create (hb_face_get_empty ());
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_font_funcs_t *
|
||||
create_font_funcs (void)
|
||||
{
|
||||
return hb_font_funcs_create ();
|
||||
}
|
||||
static void *
|
||||
static hb_font_funcs_t *
|
||||
create_font_funcs_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_shape_plan_t *
|
||||
create_shape_plan (void)
|
||||
{
|
||||
hb_segment_properties_t props = HB_SEGMENT_PROPERTIES_DEFAULT;
|
||||
|
@ -123,18 +123,18 @@ create_shape_plan (void)
|
|||
hb_face_destroy (face);
|
||||
return shape_plan;
|
||||
}
|
||||
static void *
|
||||
static hb_shape_plan_t *
|
||||
create_shape_plan_from_inert (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
static hb_unicode_funcs_t *
|
||||
create_unicode_funcs (void)
|
||||
{
|
||||
return hb_unicode_funcs_create (NULL);
|
||||
}
|
||||
static void *
|
||||
static hb_unicode_funcs_t *
|
||||
create_unicode_funcs_from_inert (void)
|
||||
{
|
||||
return hb_unicode_funcs_create (hb_unicode_funcs_get_empty ());
|
||||
|
@ -179,11 +179,11 @@ static void \
|
|||
test_object_##name (void) \
|
||||
{ \
|
||||
typedef hb_##name##_t type_t; \
|
||||
typedef void *(*create_func_t) (void); \
|
||||
typedef type_t *(*create_func_t) (void); \
|
||||
typedef type_t *(*reference_func_t) (type_t *obj); \
|
||||
typedef void (*destroy_func_t) (type_t *obj); \
|
||||
typedef hb_bool_t (*set_user_data_func_t) (type_t *obj, hb_user_data_key_t *key, void *data, hb_destroy_func_t destroy, hb_bool_t replace); \
|
||||
typedef void * (*get_user_data_func_t) (type_t *obj, hb_user_data_key_t *key); \
|
||||
typedef void * (*get_user_data_func_t) (const type_t *obj, hb_user_data_key_t *key); \
|
||||
typedef void (*make_immutable_func_t) (type_t *obj); \
|
||||
typedef hb_bool_t (*is_immutable_func_t) (type_t *obj); \
|
||||
\
|
||||
|
@ -199,15 +199,15 @@ test_object_##name (void) \
|
|||
is_immutable_func_t is_immutable; \
|
||||
const char *name; \
|
||||
} o[1] = {{\
|
||||
(create_func_t) create_##name, \
|
||||
(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, \
|
||||
(set_user_data_func_t) hb_##name##_set_user_data, \
|
||||
(get_user_data_func_t) hb_##name##_get_user_data, \
|
||||
(make_immutable_func_t) _hb_object_make_immutable, \
|
||||
(is_immutable_func_t) _hb_object_is_immutable, \
|
||||
create_##name, \
|
||||
create_##name##_from_inert, \
|
||||
hb_##name##_get_empty, \
|
||||
hb_##name##_reference, \
|
||||
hb_##name##_destroy, \
|
||||
hb_##name##_set_user_data, \
|
||||
hb_##name##_get_user_data, \
|
||||
_hb_object_make_immutable, \
|
||||
_hb_object_is_immutable, \
|
||||
#name, \
|
||||
}}; \
|
||||
\
|
||||
|
|
Loading…
Add table
Reference in a new issue