Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/librumphijack Add test case from PR lib/44552 by A...
details: https://anonhg.NetBSD.org/src/rev/01354dfb9af0
branches: trunk
changeset: 761958:01354dfb9af0
user: pooka <pooka%NetBSD.org@localhost>
date: Sat Feb 12 10:28:08 2011 +0000
description:
Add test case from PR lib/44552 by Alexander Nasonov. I also lobbed
in a test for select(0, NULL, NULL, NULL, &tv) in there.
diffstat:
tests/lib/librumphijack/h_client.c | 25 ++++++++++++++++++++++++-
tests/lib/librumphijack/t_asyncio.sh | 22 +++++++++++++++++++++-
2 files changed, 45 insertions(+), 2 deletions(-)
diffs (76 lines):
diff -r 3d186d923769 -r 01354dfb9af0 tests/lib/librumphijack/h_client.c
--- a/tests/lib/librumphijack/h_client.c Sat Feb 12 10:25:46 2011 +0000
+++ b/tests/lib/librumphijack/h_client.c Sat Feb 12 10:28:08 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_client.c,v 1.1 2011/02/11 15:38:14 pooka Exp $ */
+/* $NetBSD: h_client.c,v 1.2 2011/02/12 10:28:08 pooka Exp $ */
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -65,6 +65,29 @@
if (FD_ISSET(STDIN_FILENO, &rfds))
errx(1, "stdin fileno is still set");
exit(0);
+ } else if (strcmp(argv[1], "select_allunset") == 0) {
+ fd_set fds;
+ struct timeval tv;
+ int rv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = 1;
+
+ FD_ZERO(&fds);
+
+ rv = select(100, &fds, &fds, &fds, &tv);
+ if (rv == -1)
+ err(1, "select");
+ if (rv != 0)
+ errx(1, "select succesful");
+
+ rv = select(0, NULL, NULL, NULL, &tv);
+ if (rv == -1)
+ err(1, "select2");
+ if (rv != 0)
+ errx(1, "select2 succesful");
+
+ exit(0);
} else {
return ENOTSUP;
}
diff -r 3d186d923769 -r 01354dfb9af0 tests/lib/librumphijack/t_asyncio.sh
--- a/tests/lib/librumphijack/t_asyncio.sh Sat Feb 12 10:25:46 2011 +0000
+++ b/tests/lib/librumphijack/t_asyncio.sh Sat Feb 12 10:28:08 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_asyncio.sh,v 1.1 2011/02/11 15:38:14 pooka Exp $
+# $NetBSD: t_asyncio.sh,v 1.2 2011/02/12 10:28:08 pooka Exp $
#
# Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -47,7 +47,27 @@
rump.halt
}
+atf_test_case select_allunset cleanup
+select_allunset_head()
+{
+ atf_set "descr" "select() with no set fds in fd_set should not crash"
+}
+
+select_allunset_body()
+{
+
+ atf_check -s exit:0 ${rumpsrv} ${RUMP_SERVER}
+ atf_check -s exit:0 env LD_PRELOAD=/usr/lib/librumphijack.so \
+ $(atf_get_srcdir)/h_client select_allunset
+}
+
+select_allunset_cleanup()
+{
+ rump.halt
+}
+
atf_init_test_cases()
{
atf_add_test_case select_timeout
+ atf_add_test_case select_allunset
}
Home |
Main Index |
Thread Index |
Old Index