Code

Merged branch 'master' of git://git.tokkee.org/sysdb.
[sysdb.git] / t / utils / channel_test.c
index 20fd4543c4360fdbb2b1f473ce2a7ac517f448eb..3827c0705f7f78efa3cc77da6fc2bb526f1b6e32 100644 (file)
@@ -138,6 +138,8 @@ START_TEST(test_write_read)
 
        data = 0xffffffff;
        check = sdb_channel_read(chan, &data);
+       fail_unless(check == 0,
+                       "sdb_channel_read() = %d; expected: 0", check);
        /* result depends on endianess */
        fail_unless((data == 0xffffff00) || (data == 0x00ffffff),
                        "sdb_channel_read() returned data %x; "
@@ -155,10 +157,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);