if (error != G_IO_ERROR_NONE)
{
- g_print ("gio-test: ...from %d: G_IO_ERROR_%s\n", fd,
- (error == G_IO_ERROR_AGAIN ? "AGAIN" :
- (error == G_IO_ERROR_INVAL ? "INVAL" :
- (error == G_IO_ERROR_UNKNOWN ? "UNKNOWN" : "???"))));
+ g_print ("gio-test: ...from %d: %d\n", fd, error);
if (error == G_IO_ERROR_AGAIN)
continue;
break;
for (i = 0; i < nkiddies; i++)
if (seqtab[i].fd == fd)
{
- if (seq != seqtab[i].seq)
- {
- g_print ("gio-test: ...from %d: invalid sequence number %d, expected %d\n",
- fd, seq, seqtab[i].seq);
- g_assert_not_reached ();
- }
+ g_assert_cmpint (seq, ==, seqtab[i].seq);
seqtab[i].seq++;
break;
}
g_assert (nb == sizeof (nbytes));
- if (nbytes >= BUFSIZE)
- {
- g_print ("gio-test: ...from %d: nbytes = %d (%#x)!\n", fd, nbytes, nbytes);
- g_assert_not_reached ();
- }
+ g_assert_cmpint (nbytes, <, BUFSIZE);
g_assert (nbytes >= 0 && nbytes < BUFSIZE);
#ifdef VERBOSE
g_print ("gio-test: ...from %d: %d bytes\n", fd, nbytes);
}
for (j = 0; j < nbytes; j++)
- if (buf[j] != ' ' + ((nbytes + j) % 95))
- {
- g_print ("gio-test: ...from %d: buf[%d] == '%c', should be '%c'\n",
- fd, j, buf[j], 'a' + ((nbytes + j) % 32));
- g_assert_not_reached ();
- }
+ g_assert (buf[j] == ' ' + ((nbytes + j) % 95));
#ifdef VERBOSE
g_print ("gio-test: ...from %d: OK\n", fd);
#endif