glib/gobject
Eric Blake 2ab2ce57e6 gtestutils: Improve g_assert_cmpuint
While x86_64 has enough precision in long double to do a round trip
from guint64 to long double and back, this is platform-specific, and
is a disservice to users trying to debug failing unit tests on other
architectures where it loses precision for g_assert_cmp{int,uint,hex}.
See also https://bugzilla.gnome.org/show_bug.cgi?id=788385 which
mentions having to add casts to specifically silence the compiler on
platforms where the precision loss occurs.

Meanwhile, g_assert_cmpuint() does an unsigned comparison, but outputs
signed values if the comparison fails, which is confusing.

Fix both issues by introducing a new g_assertion_message_cmpint()
function with a new 'u' numtype.  For backwards compatibility, the
macros still call into the older g_assertion_message_cmpnum() when not
targetting 2.78, and that function still works when passed 'i' and 'x'
types even though code compiled for 2.78 and later will never invoke
it with numtype anything other than 'f'.  Note that g_assert_cmpmem
can also take advantage of the new code, even though in practice,
comparison between two size_t values representing array lengths that
can actually be compiled is unlikely to have ever hit the precision
loss.  The macros in signals.c test code does not have to worry about
versioning, since it is not part of the glib library proper.

Closes #2997
Signed-off-by: Eric Blake <eblake@redhat.com>
2023-05-09 08:28:09 -05:00
..
tests gtestutils: Improve g_assert_cmpuint 2023-05-09 08:28:09 -05:00
gatomicarray.c GAtomicArray: Ensure metadata does not misalign the payload 2023-01-29 12:36:06 +00:00
gatomicarray.h GAtomicArray: Ensure metadata does not misalign the payload 2023-01-29 12:36:06 +00:00
gbinding.c gbinding: Explicitly ignore return values from g_param_value_validate() 2022-10-18 15:12:31 +01:00
gbinding.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gbindinggroup.c gobject: add GBindingGroup 2022-01-28 16:01:22 -08:00
gbindinggroup.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gboxed.c gobject: Fix some annotations 2023-02-24 18:06:14 +01:00
gboxed.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gclosure.c gclosure: Use (transfer floating) for closure construction functions 2022-12-02 11:59:16 +00:00
gclosure.h Revert "Rename user data parameters to user_data" 2023-01-09 13:09:26 +01:00
genums.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
genums.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
glib-enumtypes.c.template Revert "meson: Use gnome.mkenum_simple()" 2022-11-24 12:06:10 +00:00
glib-enumtypes.h.template Revert "meson: Use gnome.mkenum_simple()" 2022-11-24 12:06:10 +00:00
glib-genmarshal.in Replace all uses of G_VA_COPY with Standard C va_copy 2022-10-26 18:07:55 +01:00
glib-mkenums.in glib-mkenums: evaluate private symbols too 2022-11-01 15:46:13 +01:00
glib-types.h Include GObject's visibility header 2023-01-08 00:33:47 +00:00
gmarshal.c Replace all uses of G_VA_COPY with Standard C va_copy 2022-10-26 18:07:55 +01:00
gmarshal.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gobject_gdb.py py: Various flake8 cleanups 2020-11-17 15:50:07 +00:00
gobject_probes.d Add missing semicolons to gobject_probes.d 2012-10-15 19:48:44 -04:00
gobject_trace.h Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gobject-autocleanups.h Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gobject-query.c Merge branch 'more-spdx' into 'main' 2022-07-05 11:06:49 +00:00
gobject.c gobject: Fix some annotations 2023-02-24 18:06:14 +01:00
gobject.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gobject.rc.in meson: build Windows resource files 2018-01-04 22:19:30 +01:00
gobject.stp.in glib: Namespace global tapset variables by soname 2016-11-23 10:50:39 +00:00
gobjectnotifyqueue.c Replace most GObject warnings with criticals 2022-08-09 13:18:47 -05:00
gparam.c Merge branch 'mcatanzaro/gtype-criticals' into 'main' 2022-09-19 14:35:12 +00:00
gparam.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gparamspecs.c Empty values are not valid GParamSpec 2022-09-25 14:20:24 +01:00
gparamspecs.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gsignal.c gsignal: Support G_SIGNAL_MATCH_ID in g_signal_handlers_block/unblock/disconnect_matched() 2023-04-14 15:27:11 +01:00
gsignal.h Revert "Rename user data parameters to user_data" 2023-01-09 13:09:26 +01:00
gsignalgroup.c gobject/gsignalgroup: fix memory leaks on error 2022-05-17 17:34:06 +02:00
gsignalgroup.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gsourceclosure.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gsourceclosure.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gtype-private.h Merge branch 'more-spdx' into 'main' 2022-07-05 11:06:49 +00:00
gtype.c docs: Drop outdated docs/debugging.txt 2023-04-27 23:56:59 +01:00
gtype.h docs: Drop outdated docs/debugging.txt 2023-04-27 23:56:59 +01:00
gtypemodule.c Replace most GObject warnings with criticals 2022-08-09 13:18:47 -05:00
gtypemodule.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gtypeplugin.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gtypeplugin.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gvalue.c gvalue: Fix a typo in a function name in an example in the docs 2023-03-23 12:24:33 +00:00
gvalue.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gvaluearray.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gvaluearray.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
gvaluecollector.h Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gvaluetransform.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
gvaluetypes.c gobject: Fix some annotations 2023-02-24 18:06:14 +01:00
gvaluetypes.h Rename all visibility macros 2022-10-13 20:53:56 -04:00
libgobject-gdb.py.in Rename gdb macros with _gdb suffix to avoid ns clashes 2016-05-23 10:52:10 -04:00
meson.build build: Don't overwrite build variables 2023-01-08 00:33:14 +00:00