summaryrefslogtreecommitdiff
path: root/misc/bug-hsearch1.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
committerJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
commit73c5dd45bc405428148ee740cac61a1279fe57d4 (patch)
tree878555d8c116d7ac9cb716b79e10d240fde946a3 /misc/bug-hsearch1.c
parent23a4b43d6a98912d505458daeced44b22830a773 (diff)
Updated to fedora-glibc-20090204T2135cvs/fedora-glibc-2_9_90-3
Diffstat (limited to 'misc/bug-hsearch1.c')
-rw-r--r--misc/bug-hsearch1.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/misc/bug-hsearch1.c b/misc/bug-hsearch1.c
new file mode 100644
index 0000000000..6097b5ad04
--- /dev/null
+++ b/misc/bug-hsearch1.c
@@ -0,0 +1,31 @@
+#include <search.h>
+#include <stdio.h>
+
+static int
+do_test (void)
+{
+ if (hcreate (1) == 0)
+ {
+ puts ("hcreate failed");
+ return 1;
+ }
+ ENTRY e;
+ e.key = (char *) "a";
+ e.data = (char *) "b";
+ if (hsearch (e, ENTER) == NULL)
+ {
+ puts ("ENTER failed");
+ return 1;
+ }
+ ENTRY s;
+ s.key = (char *) "c";
+ if (hsearch (s, FIND) != NULL)
+ {
+ puts ("FIND succeeded");
+ return 1;
+ }
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"