Code

channel_test: Updated timeout check according to latest changes.
authorSebastian Harl <sh@tokkee.org>
Fri, 25 Oct 2013 15:30:12 +0000 (17:30 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 25 Oct 2013 15:30:12 +0000 (17:30 +0200)
I.e. check errno rather than the return value.

t/utils/channel_test.c

index 20fd4543c4360fdbb2b1f473ce2a7ac517f448eb..02ed172a42ace53f1090e2b18379246681fe6774 100644 (file)
@@ -155,10 +155,13 @@ START_TEST(test_select)
 
        chan = sdb_channel_create(0, 1);
 
+       errno = 0;
        check = sdb_channel_select(chan, &data, NULL, NULL, NULL, &ts);
-       fail_unless(check == ETIMEDOUT,
-                       "sdb_channel_select() = %i; expected: %i (ETIMEDOUT)",
-                       check, ETIMEDOUT);
+       fail_unless(check < ETIMEDOUT,
+                       "sdb_channel_select() = %i; expected: <0", check);
+       fail_unless(errno == ETIMEDOUT,
+                       "sdb_channel_select() set errno to %i; expected: %i (ETIMEDOUT)",
+                       errno, ETIMEDOUT);
 
        check = sdb_channel_select(chan, NULL, NULL, &data, NULL, NULL);
        fail_unless(! check, "sdb_channel_select() = %i; expected: 0", check);