summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorU-D5B1PQ1J\Administrador <Administrador@D5B1PQ1J.(none)>2010-08-07 14:33:14 +0200
committerU-D5B1PQ1J\Administrador <Administrador@D5B1PQ1J.(none)>2010-08-07 15:03:54 +0200
commit7d342c723c5ae8e9312210936287810741f40bc5 (patch)
treea9870c912e8a2dbfd8bdc8aa223057b0f02822a4 /tests
parent5c2b6b2d3e60500bb6b47b57cfe4e65c2ba03751 (diff)
downloadcurl-7d342c723c5ae8e9312210936287810741f40bc5.tar.gz
build: allow NTLM tests to run on more build configurations
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/chkhostname.c4
-rw-r--r--tests/libtest/sethostname.c17
-rwxr-xr-xtests/runtests.pl5
3 files changed, 11 insertions, 15 deletions
diff --git a/tests/libtest/chkhostname.c b/tests/libtest/chkhostname.c
index 686eb471a..72c8b6a1f 100644
--- a/tests/libtest/chkhostname.c
+++ b/tests/libtest/chkhostname.c
@@ -1,6 +1,6 @@
-#include "curl_gethostname.h"
+#include "setup.h"
-#include <stdio.h>
+#include "curl_gethostname.h"
#define HOSTNAME_MAX 1024
diff --git a/tests/libtest/sethostname.c b/tests/libtest/sethostname.c
index d050f18d6..9d9fae00b 100644
--- a/tests/libtest/sethostname.c
+++ b/tests/libtest/sethostname.c
@@ -7,25 +7,20 @@
*
*/
-#include <stdlib.h>
-#include <string.h>
-
-#define GETHOSTNAME_ENV_VAR "CURL_GETHOSTNAME"
+#include "setup.h"
/*
* we force our own host name, in order to make some tests machine independent
- *
- * Since some systems think this prototype doesn't match the system provided
- * function, we AVOID including unistd.h or other headers that may include the
- * original prototype! We provide our own instead (to avoid warnings).
*/
-int gethostname(char *name, size_t namelen);
-int gethostname(char *name, size_t namelen)
+int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
+
+int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
{
- const char *force_hostname = getenv(GETHOSTNAME_ENV_VAR);
+ const char *force_hostname = getenv("CURL_GETHOSTNAME");
if(force_hostname) {
strncpy(name, force_hostname, namelen);
+ name[namelen-1] = '\0';
return 0;
}
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 8bb5d69e9..a97d8647e 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -2376,8 +2376,9 @@ sub singletest {
delete $ENV{$var} if($ENV{$var});
}
else {
- if(($has_shared ne "yes") && ($var =~ /^LD_PRELOAD/)) {
- # print "Skipping LD_PRELOAD due to no shared build\n";
+ if(($var =~ /^LD_PRELOAD/) &&
+ ($debug_build || ($has_shared ne "yes"))) {
+ # print "Skipping LD_PRELOAD due to no release shared build\n";
next;
}
$ENV{$var} = "$content";