summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile4
-rw-r--r--tests/test_FD_CLR_SETSIZE.c14
-rw-r--r--tests/test_FD_CLR_negative.c14
-rw-r--r--tests/test_FD_SET_SETSIZE.c14
-rw-r--r--tests/test_FD_SET_negative.c14
5 files changed, 60 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 5dc4390..9a65cf3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -62,6 +62,10 @@ TARGETS= \
62 test_recvfrom \ 62 test_recvfrom \
63 test_send \ 63 test_send \
64 test_sendto \ 64 test_sendto \
65 test_FD_CLR_negative \
66 test_FD_CLR_SETSIZE \
67 test_FD_SET_negative \
68 test_FD_SET_SETSIZE \
65 69
66.SILENT: 70.SILENT:
67 71
diff --git a/tests/test_FD_CLR_SETSIZE.c b/tests/test_FD_CLR_SETSIZE.c
new file mode 100644
index 0000000..cd571f1
--- /dev/null
+++ b/tests/test_FD_CLR_SETSIZE.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <sys/select.h>
4
5int main(int argc, char** argv) {
6 fd_set rfds;
7
8 CHK_FAIL_START
9 FD_CLR(FD_SETSIZE, &rfds);
10 CHK_FAIL_END
11
12 puts((const char*)&rfds);
13 return ret;
14}
diff --git a/tests/test_FD_CLR_negative.c b/tests/test_FD_CLR_negative.c
new file mode 100644
index 0000000..43b5e42
--- /dev/null
+++ b/tests/test_FD_CLR_negative.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <sys/select.h>
4
5int main(int argc, char** argv) {
6 fd_set rfds;
7
8 CHK_FAIL_START
9 FD_CLR(-1, &rfds);
10 CHK_FAIL_END
11
12 puts((const char*)&rfds);
13 return ret;
14}
diff --git a/tests/test_FD_SET_SETSIZE.c b/tests/test_FD_SET_SETSIZE.c
new file mode 100644
index 0000000..87e197e
--- /dev/null
+++ b/tests/test_FD_SET_SETSIZE.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <sys/select.h>
4
5int main(int argc, char** argv) {
6 fd_set rfds;
7
8 CHK_FAIL_START
9 FD_SET(FD_SETSIZE, &rfds);
10 CHK_FAIL_END
11
12 puts((const char*)&rfds);
13 return ret;
14}
diff --git a/tests/test_FD_SET_negative.c b/tests/test_FD_SET_negative.c
new file mode 100644
index 0000000..df0aa0c
--- /dev/null
+++ b/tests/test_FD_SET_negative.c
@@ -0,0 +1,14 @@
1#include "common.h"
2
3#include <sys/select.h>
4
5int main(int argc, char** argv) {
6 fd_set rfds;
7
8 CHK_FAIL_START
9 FD_SET(-1, &rfds);
10 CHK_FAIL_END
11
12 puts((const char*)&rfds);
13 return ret;
14}