Skip to content
Commits on Source (9)
......@@ -51,7 +51,7 @@ dist-job:
pages:
stage: deploy
only:
- master
- main
script:
- meson -Db_coverage=true -Ddocumentation=true _build .
- ninja -C _build test libglib-testing-doc
......
Overview of changes in libglib-testing 0.1.1
============================================
* Bugs fixed:
- !10 docs: Make the API stability policy a little more mature
- !11 signal-logger: Don’t pass NULL to G_VALUE_LCOPY()
- !12 Fix subproject build with recent meson
Overview of changes in libglib-testing 0.1.0
============================================
......
......@@ -10,7 +10,10 @@ libglib-testing is a separate project from GLib itself for two reasons:
• To keep test harness API out of libglib, since it should only be needed
at test time, not at runtime.
All the library APIs are currently unstable and are likely to change wildly.
All new library APIs are unstable and have the potential to change wildly after
they’re added. After they have been used for a couple of months, they are
unlikely to change further. Consideration will be made for how widely used an
API is before potentially changing or breaking it.
Dependencies
============
......
......@@ -17,26 +17,14 @@ libglib_testing_public_deps = [
libglib_testing_include_subdir = join_paths(libglib_testing_api_name, 'libglib-testing')
# FIXME: https://github.com/mesonbuild/meson/issues/2992
if meson.is_subproject()
libglib_testing = static_library(libglib_testing_api_name,
libglib_testing_sources + libglib_testing_headers,
dependencies: libglib_testing_public_deps,
include_directories: root_inc,
install: not meson.is_subproject(),
version: meson.project_version(),
soversion: libglib_testing_api_version,
)
else
libglib_testing = library(libglib_testing_api_name,
libglib_testing_sources + libglib_testing_headers,
dependencies: libglib_testing_public_deps,
include_directories: root_inc,
install: not meson.is_subproject(),
version: meson.project_version(),
soversion: libglib_testing_api_version,
)
endif
libglib_testing = library(libglib_testing_api_name,
libglib_testing_sources + libglib_testing_headers,
dependencies: libglib_testing_public_deps,
include_directories: root_inc,
install: not meson.is_subproject(),
version: meson.project_version(),
soversion: libglib_testing_api_version,
)
libglib_testing_dep = declare_dependency(
link_with: libglib_testing,
......
......@@ -142,6 +142,29 @@ gt_signal_logger_emission_free (GtSignalLoggerEmission *emission)
g_free (emission);
}
/* Version of G_VALUE_LCOPY() that allows %NULL return locations. */
#define VALUE_LCOPY(value, var_args, __error) \
G_STMT_START { \
const GValue *_value = (value); \
GType _value_type = G_VALUE_TYPE (_value); \
GTypeValueTable *_vtable = g_type_value_table_peek (_value_type); \
const gchar *_lcopy_format = _vtable->lcopy_format; \
GTypeCValue _cvalues[G_VALUE_COLLECT_FORMAT_MAX_LENGTH] = { { 0, }, }; \
guint _n_values = 0; \
\
while (*_lcopy_format != '\0') \
{ \
g_assert (*_lcopy_format == G_VALUE_COLLECT_POINTER); \
_cvalues[_n_values++].v_pointer = va_arg ((var_args), gpointer); \
_lcopy_format++; \
} \
\
if (_n_values == 2 && !!_cvalues[0].v_pointer != !!_cvalues[1].v_pointer) \
*(__error) = g_strdup_printf ("all return locations need the same nullability"); \
else if (_cvalues[0].v_pointer != NULL) \
*(__error) = _vtable->lcopy_value (_value, _n_values, _cvalues, 0); \
} G_STMT_END
/**
* gt_signal_logger_emission_get_params:
* @self: a #GtSignalLoggerEmission
......@@ -167,7 +190,7 @@ gt_signal_logger_emission_get_params (GtSignalLoggerEmission *self,
for (gsize i = 0; i < self->n_param_values; i++)
{
g_autofree gchar *error_message = NULL;
G_VALUE_LCOPY (&self->param_values[i], ap, 0, &error_message);
VALUE_LCOPY (&self->param_values[i], ap, &error_message);
/* Error messages are not fatal, as they typically indicate that the user
* has passed in %NULL rather than a valid return pointer. We can recover
......
project('libglib-testing','c',
version: '0.1.0',
meson_version: '>= 0.45.0',
version: '0.1.1',
meson_version: '>= 0.54.0',
license: 'LGPLv2.1+',
default_options: [
'c_std=gnu11',
......@@ -98,4 +98,4 @@ test_env = [
'LC_ALL=C.UTF-8',
]
subdir('libglib-testing')
\ No newline at end of file
subdir('libglib-testing')