1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
22 #include "curlcheck.h"
24 #define ENABLE_CURLX_PRINTF
29 #include "memdebug.h" /* LAST include file */
31 static CURLcode unit_setup( void )
36 static void unit_stop( void )
41 static void mydtor(void *p)
50 size_t klen = sizeof(int);
52 struct curl_hash hash_static;
57 rc = Curl_hash_init(&hash_static, 7, Curl_hash_str,
58 Curl_str_key_compare, mydtor);
62 fail("Curl_hash_init failed to initialize static hash!");
66 value = malloc(sizeof(int));
67 value2 = malloc(sizeof(int));
71 Curl_hash_add(&hash_static, &key, klen, value);
73 Curl_hash_clean(&hash_static);
75 /* Attempt to add another key/value pair */
76 Curl_hash_add(&hash_static, &key2, klen, value2);
78 Curl_hash_destroy(&hash_static);