glib/gobject/tests
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
..
performance tests: Don’t run the GObject performance tests under valgrind 2023-02-16 12:52:30 +00:00
accumulator.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
autoptr.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
basic-signals.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
basics-gobject.c tests: Fix a non-TAP formatted debug message in the basics-gobject test 2022-06-21 12:50:31 +01:00
binding.c Replace most GObject warnings with criticals 2022-08-09 13:18:47 -05:00
bindinggroup.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
boxed.c Rename G_MARKUP_PARSE_FLAGS_NONE 2022-07-25 22:30:22 +01:00
closure-refcount.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
closure.c Fix the closure test in continuous 2014-05-30 10:22:35 -04:00
custom-dispatch.c custom-dispatch: Change SPDX-License-Identifier to match license grant 2022-11-02 12:35:45 +00:00
cxx.cpp Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
defaultiface.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
deftype.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
deprecated-properties.c gobject: Add a test for deprecated properties 2022-09-21 10:27:55 +01:00
dynamictests.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
dynamictype.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
enums.c Use varargs for enum types definition macros 2022-06-30 01:46:54 +01:00
flags.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
genmarshal.py Replace all uses of G_VA_COPY with Standard C va_copy 2022-10-26 18:07:55 +01:00
gobject-query.py tests: Fix code style in Python files to satisfy black and flake8 2022-10-19 12:28:08 +01:00
ifaceproperties.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
marshalers.list Moving gobject tests from tests/gobjects to gobjects/tests 2022-05-26 19:13:19 +01:00
max-version.c tests: Test that we can include all headers with an old MAX_VERSION 2022-10-27 14:50:48 +01:00
meson.build meson: Use exitcode protocol for some c++ and gobject definition tests 2023-01-17 21:08:48 +01:00
mkenums.py tests/mkenums.py: add a test case for symbolic expression evaluation 2022-11-01 16:06:20 +01:00
notify-init2.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
notify-init.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
object.c testsuite: Make tests not fail in !debug builds 2022-05-28 08:02:16 -04:00
objects-refcount1.c gtype: avoid "-Wcast-align" warning with optimized G_TYPE_CHECK_INSTANCE_CAST() 2022-12-16 20:48:06 +01:00
objects-refcount2.c Moving tests/refcount/ directory to gobject/tests/ 2022-05-26 18:37:35 +01:00
override.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
param.c gobject/tests/param: Add unit test for handling invalid NULL param spec 2022-10-10 21:01:10 +02:00
private.c glib: Avoid redefining GLIB_DISABLE_DEPRECATION_WARNINGS 2020-07-27 15:41:09 +01:00
properties-refcount1.c tests: Port GObject tests from g_thread_create() to g_thread_new() 2022-05-26 18:37:35 +01:00
properties-refcount2.c Moving tests/refcount/ directory to gobject/tests/ 2022-05-26 18:37:35 +01:00
properties-refcount3.c tests: Remove various bits of overly-verbose test output 2022-05-31 15:21:46 +01:00
properties-refcount4.c Moving tests/refcount/ directory to gobject/tests/ 2022-05-26 18:37:35 +01:00
properties.c gobject: Always ref-sink variants in g_object_set 2022-10-24 10:47:35 +01:00
qdata.c Add SPDX license headers for LGPL-2.1-or-later to various files 2022-06-01 12:44:23 +01:00
reference.c gobject: Do not call toggle down notifications if current refcount is not 1 2022-12-06 04:38:26 +01:00
references.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
signal-handler.c tests: Allow signal-handler performance tests to be smoketested 2022-06-21 12:57:33 +01:00
signalgroup.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
signals-refcount.c tests: Remove various bits of overly-verbose test output 2022-05-31 15:21:46 +01:00
signals.c gtestutils: Improve g_assert_cmpuint 2023-05-09 08:28:09 -05:00
singleton.c Merge branch 'more-spdx' into 'main' 2022-07-05 11:06:49 +00:00
taptestrunner.py tests: Add some SPDX license headers 2022-05-17 17:23:34 +01:00
testcommon.h tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
testing.c Merge branch 'more-spdx' into 'main' 2022-07-05 11:06:49 +00:00
testmodule.c tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
testmodule.h tests: Add SPDX license headers automatically 2022-06-01 12:17:28 +01:00
threadtests.c Add a SPDX LicenseRef for the license historically used for tests 2022-11-02 12:34:19 +00:00
type-flags.c tests: Add type flag tests for interfaces 2023-04-13 15:39:37 +01:00
type.c gobject/tests: Don't unref a floating object reference by mistake 2022-09-21 11:19:52 +01:00
value.c gobject: Avoid the ref/unref dance if assigning the same to a value 2022-12-20 17:48:21 +01:00