tests: Don't assume that isinf() returns the sign of the inf

The man pages on Linux specify that isinf() returns the sign of the
infinity. This isn't what the C99 standard mandates, so there are
compilers that only returns 1 or 0. We obviously want to test the sign
of the infinity resulting from a conversion. This changeset introduces
a small helper function in the relevant test case that always has the
same behavior as the GNU implementation of isinf().