From 73c5dd45bc405428148ee740cac61a1279fe57d4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 4 Feb 2009 22:36:03 +0000 Subject: Updated to fedora-glibc-20090204T2135 --- misc/bug-hsearch1.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 misc/bug-hsearch1.c (limited to 'misc/bug-hsearch1.c') 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 +#include + +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" -- cgit v1.2.3