tests: Fix overflows in find_maximum_supported_tv_sec()
commit428acd9b1486beba186c073577ea659eee44ae0a
authorPhilip Withnall <withnall@endlessm.com>
Mon, 19 Jun 2017 12:57:36 +0000 (19 13:57 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Wed, 21 Jun 2017 10:21:31 +0000 (21 11:21 +0100)
tree1aaf3d22d27706a5c082a34fa13ba0f6f580e193
parent30fed3b906f3408aa4fc9a7996fa03cf7b940ebe
tests: Fix overflows in find_maximum_supported_tv_sec()

The addition (highest_success + lowest_failure) could have overflowed,
and typically would do on 32-bit platforms where the real
highest_success should be G_MAXLONG. Fix that, and introduce special
handling of the corner case of (highest_success = G_MAXLONG).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=783841
glib/tests/gdatetime.c