4 Commits

Author SHA1 Message Date
Philip Withnall
e27d64e651
tests: Fix -Wsign-conversion warnings for random ints in gobject tests
There’s a painful inconsistency in the types of the
`g_{test_rand,random,rand}_int{,_range}()` functions, which vary
arbitrarily between `gint32` and `guint32`.

Unfortunately since those functions mention `int` explicitly in the name
(and then some of them return an `unsigned` integer), I don’t see a way
to make the APIs consistent without significant deprecations or
additions.

So, for the moment, to fix various `-Wsign-conversion` warnings, plaster
the tests with casts.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3405
2025-04-11 23:48:14 +01:00
Philip Withnall
683cf0a1ba
tests: Fix a scan-build warning about uninitialised variables
It’s a false positive, but points to a slightly unnecessary use of a
global variable to store something which could be computed per-test.

scan-build thought that arrays of size `n_handlers` could have
uninitialised values accessed in them if `n_handlers` were to change
value part-way through a test (which it didn’t).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-09-12 23:25:06 +01:00
Philip Withnall
1aaf1e7de1 tests: Allow signal-handler performance tests to be smoketested
As with the previous commit, allow them to be smoketested when run
without `-m perf`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-21 12:57:33 +01:00
Matthias Clasen
8a97dc5652 Add a performance test for signal connection
This test checks the performance of connecting, disconnecting and
blocking many handlers. Various cases are checked: disconnect in
the same order, in the inverse order, at random. Connect to one
signal on a single object, to two signals on the same object, or
to the same signal on two different objects.

https://bugzilla.gnome.org/show_bug.cgi?id=737009
2015-05-27 14:41:19 -04:00