diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-02-03 20:59:54 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-02-03 21:03:11 +0100 |
commit | 83bb07027db631b880acaf2240cc2cb2b73cf1bc (patch) | |
tree | 89ddbf9a4de9db13254723e9bcddadbf32bc910d /tests/libtest | |
parent | 6b68aa989c9d5f6c031e992f44e5ad792ab48994 (diff) |
unit1600: unit test for Curl_ntlm_core_mk_nt_hash
Diffstat (limited to 'tests/libtest')
-rw-r--r-- | tests/libtest/first.c | 16 | ||||
-rw-r--r-- | tests/libtest/test.h | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 5851faf62..0ead39d67 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -111,6 +111,20 @@ static void memory_tracking_init(void) # define memory_tracking_init() Curl_nop_stmt #endif +/* returns a hexdump in a static memory area */ +char *hexdump(unsigned char *buffer, size_t len) +{ + static char dump[200*3+1]; + char *p = dump; + size_t i; + if(len > 200) + return NULL; + for(i=0; i<len; i++, p += 3) + snprintf(p, 4, "%02x ", buffer[i]); + return dump; +} + + int main(int argc, char **argv) { char *URL; diff --git a/tests/libtest/test.h b/tests/libtest/test.h index 4186c4f26..fb95996aa 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -63,6 +63,8 @@ extern void wait_ms(int ms); /* wait this many milliseconds */ extern int test(char *URL); /* the actual test function provided by each individual libXXX.c file */ +extern char *hexdump(unsigned char *buffer, size_t len); + #ifdef UNITTESTS extern int unitfail; #endif |