summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b2ea91b)
raw | patch | inline | side by side (parent: b2ea91b)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 20 Oct 2013 13:37:03 +0000 (15:37 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 20 Oct 2013 13:37:03 +0000 (15:37 +0200) |
t/utils/channel_test.c | patch | blob | history |
diff --git a/t/utils/channel_test.c b/t/utils/channel_test.c
index 30fc263a263a33b6edfc655bfcb8682174d98e7c..20fd4543c4360fdbb2b1f473ce2a7ac517f448eb 100644 (file)
--- a/t/utils/channel_test.c
+++ b/t/utils/channel_test.c
#include "libsysdb_test.h"
#include <check.h>
+#include <errno.h>
#include <limits.h>
#include <stdint.h>
}
END_TEST
+START_TEST(test_select)
+{
+ struct timespec ts = { 0, 10 };
+ int check;
+ int data;
+
+ chan = sdb_channel_create(0, 1);
+
+ check = sdb_channel_select(chan, &data, NULL, NULL, NULL, &ts);
+ fail_unless(check == ETIMEDOUT,
+ "sdb_channel_select() = %i; expected: %i (ETIMEDOUT)",
+ check, ETIMEDOUT);
+
+ check = sdb_channel_select(chan, NULL, NULL, &data, NULL, NULL);
+ fail_unless(! check, "sdb_channel_select() = %i; expected: 0", check);
+ check = sdb_channel_select(chan, NULL, NULL, &data, NULL, &ts);
+ fail_unless(! check, "sdb_channel_select() = %i; expected: 0", check);
+
+ sdb_channel_destroy(chan);
+}
+END_TEST
+
START_TEST(test_write_int)
{
size_t i;
tc = tcase_create("core");
tcase_add_test(tc, test_create);
tcase_add_test(tc, test_write_read);
+ tcase_add_test(tc, test_select);
suite_add_tcase(s, tc);
tc = tcase_create("integer");