aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-08 09:33:42 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-10 18:38:57 +0100
commit05b100aee247bb9bec8e9a1b0166496aa4248d1c (patch)
treea0ab4d620d8102de82b08a67609394b0d2f09608 /tests
parent9a36c0ae21d675587d4e2a52c50a6ce8a2150770 (diff)
cleanup: make local functions static
urlapi: turn three local-only functions into statics conncache: make conncache_find_first_connection static multi: make detach_connnection static connect: make getaddressinfo static curl_ntlm_core: make hmac_md5 static http2: make two functions static http: make http_setup_conn static connect: make tcpnodelay static tests: make UNITTEST a thing to mark functions with, so they can be static for normal builds and non-static for unit test builds ... and mark Curl_shuffle_addr accordingly. url: make up_free static setopt: make vsetopt static curl_endian: make write32_le static rtsp: make rtsp_connisdead static warnless: remove unused functions memdebug: remove one unused function, made another static
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unit1607.c10
-rw-r--r--tests/unit/unit1608.c5
-rw-r--r--tests/unit/unit1609.c10
3 files changed, 18 insertions, 7 deletions
diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c
index 64b6371ee..22c2e8482 100644
--- a/tests/unit/unit1607.c
+++ b/tests/unit/unit1607.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, 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
@@ -25,6 +25,10 @@
#include "connect.h"
#include "share.h"
+/* retrieves ip address and port from a sockaddr structure.
+ note it calls Curl_inet_ntop which sets errno on fail, not SOCKERRNO. */
+bool getaddressinfo(struct sockaddr *sa, char *addr, long *port);
+
#include "memdebug.h" /* LAST include file */
static struct Curl_easy *easy;
@@ -159,8 +163,8 @@ UNITTEST_START
if(tests[i].address[j] == &skip)
continue;
- if(addr && !Curl_getaddressinfo(addr->ai_addr,
- ipaddress, &port)) {
+ if(addr && !getaddressinfo(addr->ai_addr,
+ ipaddress, &port)) {
fprintf(stderr, "%s:%d tests[%d] failed. getaddressinfo failed.\n",
__FILE__, __LINE__, i);
problem = true;
diff --git a/tests/unit/unit1608.c b/tests/unit/unit1608.c
index 9ae474ba9..4fc24704b 100644
--- a/tests/unit/unit1608.c
+++ b/tests/unit/unit1608.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, 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
@@ -23,6 +23,9 @@
#include "hostip.h"
+CURLcode Curl_shuffle_addr(struct Curl_easy *data,
+ Curl_addrinfo **addr);
+
#define NUM_ADDRS 8
static struct Curl_addrinfo addrs[NUM_ADDRS];
diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c
index 2b99bee9b..865c9e459 100644
--- a/tests/unit/unit1609.c
+++ b/tests/unit/unit1609.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, 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
@@ -25,6 +25,10 @@
#include "connect.h"
#include "share.h"
+/* retrieves ip address and port from a sockaddr structure.
+ note it calls Curl_inet_ntop which sets errno on fail, not SOCKERRNO. */
+bool getaddressinfo(struct sockaddr *sa, char *addr, long *port);
+
#include "memdebug.h" /* LAST include file */
static struct Curl_easy *easy;
@@ -158,8 +162,8 @@ UNITTEST_START
if(!addr && !tests[i].address[j])
break;
- if(addr && !Curl_getaddressinfo(addr->ai_addr,
- ipaddress, &port)) {
+ if(addr && !getaddressinfo(addr->ai_addr,
+ ipaddress, &port)) {
fprintf(stderr, "%s:%d tests[%d] failed. getaddressinfo failed.\n",
__FILE__, __LINE__, i);
problem = true;