The previous implementation only echoed the p/q conversion results _if_
the return code signalled success but the result was unexpected. Although
the errno value for failed conversion attempts (non-zero return codes)
is not too helpful, seeing which text input failed the test is desirable.
#include <config.h>
#include <check.h>
+#include <errno.h>
#include <locale.h>
#include <libsigrok/libsigrok.h>
#include "lib.h"
struct sr_rational rational;
ret = sr_parse_rational(input, &rational);
- fail_unless(ret == SR_OK);
+ fail_unless(ret == SR_OK, "Unexpected rc for '%s': %d, errno %d.",
+ input, ret, errno);
fail_unless((expected.p == rational.p) && (expected.q == rational.q),
"Invalid result for '%s': %ld/%ld'.",
input, rational.p, rational.q);