mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 02:32:11 +01:00
tests: Rearrange double/int comparisons in srvtarget to avoid casts
By keeping `expected` as a `double` for longer, we avoid having to cast when populating the elements of `ordering`, to avoid `-Wfloat-conversion` warnings. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
parent
2713255574
commit
ebe609eeef
@ -30,7 +30,8 @@
|
||||
|
||||
struct {
|
||||
const char *order;
|
||||
int expected, seen;
|
||||
gdouble expected;
|
||||
unsigned int seen;
|
||||
} ordering[] = {
|
||||
/* There are 32 legitimate orderings; the result always has to start
|
||||
* with either "fe" (usually) or "ef" (rarely). For the remaining
|
||||
@ -141,8 +142,8 @@ test_srv_target_ordering (void)
|
||||
*/
|
||||
for (o = 0; o < NUM_ORDERINGS; o++)
|
||||
{
|
||||
g_assert_cmpint (ordering[o].seen, >, ordering[o].expected / 2);
|
||||
g_assert_cmpint (ordering[o].seen, <, ordering[o].expected * 2);
|
||||
g_assert_cmpuint (ordering[o].seen, >, (guint64) (ordering[o].expected / 2));
|
||||
g_assert_cmpuint (ordering[o].seen, <, (guint64) (ordering[o].expected * 2));
|
||||
}
|
||||
|
||||
g_resolver_free_targets (targets);
|
||||
|
Loading…
x
Reference in New Issue
Block a user