blob: 6097b5ad041020a247102efa09285a4944bd54c3 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <search.h>
2#include <stdio.h>
3
4static int
5do_test (void)
6{
7 if (hcreate (1) == 0)
8 {
9 puts ("hcreate failed");
10 return 1;
11 }
12 ENTRY e;
13 e.key = (char *) "a";
14 e.data = (char *) "b";
15 if (hsearch (e, ENTER) == NULL)
16 {
17 puts ("ENTER failed");
18 return 1;
19 }
20 ENTRY s;
21 s.key = (char *) "c";
22 if (hsearch (s, FIND) != NULL)
23 {
24 puts ("FIND succeeded");
25 return 1;
26 }
27 return 0;
28}
29
30#define TEST_FUNCTION do_test ()
31#include "../test-skeleton.c"