tidy-up: miscellaneous

- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000
This commit is contained in:
Viktor Szakats 2026-03-09 12:27:12 +01:00
parent 3512b673dd
commit e0dd6eb4a4
No known key found for this signature in database
148 changed files with 612 additions and 684 deletions

View file

@ -137,7 +137,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
}
curl_multi_remove_handle(multi, msg->easy_handle);
curl_easy_cleanup(msg->easy_handle);
curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
"(%d now running)\n", xfer_id, running_handles);
}
}

View file

@ -221,7 +221,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
curl_multi_remove_handle(multi, msg->easy_handle);
curl_easy_cleanup(msg->easy_handle);
--ongoing;
curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
"(%d now running)\n", xfer_id, running_handles);
}
}

View file

@ -240,7 +240,7 @@ static const struct testcase get_parts_list[] = {
0, 0, CURLUE_OK},
{"https://curl.se/# ",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20",
CURLU_URLENCODE|CURLU_ALLOW_SPACE, 0, CURLUE_OK},
CURLU_URLENCODE | CURLU_ALLOW_SPACE, 0, CURLUE_OK},
{"", "", 0, 0, CURLUE_MALFORMED_INPUT},
{" ", "", 0, 0, CURLUE_MALFORMED_INPUT},
{"1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
@ -261,7 +261,7 @@ static const struct testcase get_parts_list[] = {
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"https://user@example.net?hello# space ",
"https | user | [12] | [13] | example.net | [15] | / | hello | %20space%20",
CURLU_ALLOW_SPACE|CURLU_URLENCODE, 0, CURLUE_OK},
CURLU_ALLOW_SPACE | CURLU_URLENCODE, 0, CURLUE_OK},
{"https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://example.com%252f%40@example.net",
"https | example.com%2f@ | [12] | [13] | example.net | [15] | / "
@ -387,7 +387,7 @@ static const struct testcase get_parts_list[] = {
CURLU_DEFAULT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
/* no space allowed in scheme */
{"htt ps://user:password@example.net/get?this=and-what", "",
CURLU_NON_SUPPORT_SCHEME|CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
CURLU_NON_SUPPORT_SCHEME | CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
{"https://user:password@example.net/get?this=and what",
"https | user | password | [13] | example.net | [15] | /get | "
"this=and what | [17]",
@ -472,7 +472,7 @@ static const struct testcase get_parts_list[] = {
CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST},
{"boing:80",
"https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]",
CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME, 0, CURLUE_OK},
CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME, 0, CURLUE_OK},
{"http://[fd00:a41::50]:8080",
"http | [11] | [12] | [13] | [fd00:a41::50] | 8080 | / | [16] | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
@ -1433,11 +1433,11 @@ static const struct redircase set_url_list[] = {
{"http://example.com/please/../gimme/%TESTNUMBER?foobar#hello",
"http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no",
"http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no",
0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
{"http://local.test?redirect=http://local.test:80?-321",
"http://local.test:80?-123",
"http://local.test:80/?-123",
0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
{"http://local.test?redirect=http://local.test:80?-321",
"http://local.test:80?-123",
"http://local.test:80/?-123",

View file

@ -27,7 +27,7 @@ static CURLcode test_lib1965(const char *URL)
{
CURLcode result = CURLE_OK;
CURLUcode rc;
const char *schemes[] = {
static const char *schemes[] = {
"bad!", "bad{", "bad/", "bad\\", "a!",
"a+123", "http-2", "http.1",
"a+-.123", "http-+++2", "http.1--",
@ -35,9 +35,9 @@ static CURLcode test_lib1965(const char *URL)
"ABC2", "2CBA", "", "a",
"aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd",
"aaaaaaaaaabbbbbbbbbbccccccccccdddddddddde",
NULL};
NULL };
int i;
(void) URL;
(void)URL;
global_init(CURL_GLOBAL_ALL);

View file

@ -34,7 +34,7 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info)
/* Chains with only a single certificate are always in order */
if(cert_info->num_of_certs <= 1)
return 1;
return true;
/* Enumerate each certificate in the chain */
for(cert = 0; cert < cert_info->num_of_certs; cert++) {

View file

@ -163,26 +163,26 @@ static CURLcode test_lib517(const char *URL)
#if SIZEOF_TIME_T > 4
{ "2094 Nov 6 08:49:37", 3939871777 },
#endif
{ "01 Jan 2001 8:0:0", 978336000},
{ "01 Jan 2001 8:00:0", 978336000},
{ "01 Jan 2001 8:0:0", 978336000 },
{ "01 Jan 2001 8:00:0", 978336000 },
/* Out-of-range day-of-month Cases */
{ "29 Feb 2023 12:00:00 GMT", 1677672000},
{ "31 Apr 2024 12:00:00 GMT", 1714564800},
{ "30 Feb 2024 12:00:00 GMT", 1709294400},
{ "01-13-2024", -1},
{ "32 Jan 2024", -1},
{ "31 Jan 2024", 1706659200},
{ "32 Feb 2024", -1},
{ "32 Mar 2024", -1},
{ "32 Apr 2024", -1},
{ "32 May 2024", -1},
{ "32 Jun 2024", -1},
{ "32 Jul 2024", -1},
{ "32 Aug 2024", -1},
{ "32 Sep 2024", -1},
{ "32 Oct 2024", -1},
{ "32 Nov 2024", -1},
{ "32 Dec 2024", -1},
{ "29 Feb 2023 12:00:00 GMT", 1677672000 },
{ "31 Apr 2024 12:00:00 GMT", 1714564800 },
{ "30 Feb 2024 12:00:00 GMT", 1709294400 },
{ "01-13-2024", -1 },
{ "32 Jan 2024", -1 },
{ "31 Jan 2024", 1706659200 },
{ "32 Feb 2024", -1 },
{ "32 Mar 2024", -1 },
{ "32 Apr 2024", -1 },
{ "32 May 2024", -1 },
{ "32 Jun 2024", -1 },
{ "32 Jul 2024", -1 },
{ "32 Aug 2024", -1 },
{ "32 Sep 2024", -1 },
{ "32 Oct 2024", -1 },
{ "32 Nov 2024", -1 },
{ "32 Dec 2024", -1 },
/* Timezone Offsets */
{ "Sun, 06 Nov 1994 08:49:37 +0530", 784091977 },
{ "Sun, 06 Nov 1994 08:49:37 +0545", 784091077 },
@ -221,18 +221,18 @@ static CURLcode test_lib517(const char *URL)
/* Y2K38 & Historical Boundaries */
#if SIZEOF_TIME_T > 4
/* for 32 bit time_t, we bail on >year 2037 */
{ "19 Jan 2038 03:14:07 GMT", 2147483647},
{ "19 Jan 2038 03:14:08 GMT", 2147483648},
{ "01 Jan 69 00:00:00 GMT", 3124224000},
{ "19 Jan 2038 03:14:07 GMT", 2147483647 },
{ "19 Jan 2038 03:14:08 GMT", 2147483648 },
{ "01 Jan 69 00:00:00 GMT", 3124224000 },
#endif
{ "01 Jan 1500 00:00:00 GMT", -1},
{ "01 Jan 1500 00:00:00 GMT", -1 },
/* Formatting & Malformed Junk */
{ "Sun, 06-Nov/1994 08:49:37", 784111777},
{ "Sun, 06 Nov 1994 08:49:37 GMT", 784111777},
{ " Sun, 06 Nov 1994 08:49:37 GMT ", 784111777},
{ "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1},
{ "Sun, 06-Nov/1994 08:49:37", 784111777 },
{ "Sun, 06 Nov 1994 08:49:37 GMT", 784111777 },
{ " Sun, 06 Nov 1994 08:49:37 GMT ", 784111777 },
{ "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1 },
/* wrong day name is ignored */
{ "Monday, 06 Nov 1994 08:49:37 GMT", 784111777},
{ "Monday, 06 Nov 1994 08:49:37 GMT", 784111777 },
{ NULL, 0 }
};

View file

@ -375,7 +375,7 @@ static CURLcode test_lib1521(const char *URL)
curl_socket_t sockfd;
const struct curl_certinfo *certinfo;
struct curl_tlssessioninfo *tlssession;
struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0};
struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0 };
CURLcode result = CURLE_OK;
(void)URL;
global_init(CURL_GLOBAL_ALL);
@ -455,7 +455,7 @@ while(<STDIN>) {
"${w3} curl_easy_setopt(curl, $name,";
my $ignoreset = "${w3}/* set string again to check for leaks */\n".
"${w3}(void)curl_easy_setopt(curl, $name,";
my $i = ' ' x (length($w) + 25);
my $i = ' ' x (length($w) + 21);
my $fcheck = <<MOO
if(first && present(first)) /* first setopt check only */
err("$name", first, __LINE__);
@ -515,7 +515,7 @@ MOO
elsif($type eq "CURLOPTTYPE_OFF_T") {
print $fh "${fpref} OFF_NO);\n$flongcheckzero";
print $fh "$ifpresent";
my $lvl = " " x 29;
my $lvl = " " x 25;
print $fh "${pref}\n${lvl}(curl_off_t)22);\n$longcheck";
print $fh "${pref} OFF_HI);\n$longcheck";
print $fh "${pref} OFF_LO);\n$longcheck";

View file

@ -36,7 +36,7 @@ my $what=$ARGV[2];
# Read the output of curl --version
my $curl_protocols="";
open(CURL, "$ARGV[1]") || die "Cannot get curl $what list\n";
open(CURL, $ARGV[1]) || die "Cannot get curl $what list\n";
while(<CURL>) {
$curl_protocols = $_ if(/$what:/i);
}

View file

@ -34,7 +34,7 @@ if($#ARGV != 2) {
my $what=$ARGV[2];
# Read the output of curl --version
open(CURL, "$ARGV[1]") || die "Cannot open curl --version list in $ARGV[1]\n";
open(CURL, $ARGV[1]) || die "Cannot open curl --version list in $ARGV[1]\n";
$_ = <CURL>;
chomp;
/libcurl\/([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)/;

View file

@ -173,8 +173,8 @@ sub exe_ext {
if($ENV{'CURL_TEST_EXE_EXT'}) {
return $ENV{'CURL_TEST_EXE_EXT'};
}
if($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
return $ENV{'CURL_TEST_EXE_EXT_'.$component};
if($ENV{'CURL_TEST_EXE_EXT_' . $component}) {
return $ENV{'CURL_TEST_EXE_EXT_' . $component};
}
if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
$^O eq 'dos' || $^O eq 'os2') {

View file

@ -114,9 +114,9 @@ use memanalyzer;
#######################################################################
# Global variables set elsewhere but used only by this package
# These may only be set *before* runner_init is called
our $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging
our $valgrind_logfile="--log-file"; # the option name for valgrind >=3
our $valgrind_tool="--tool=memcheck";
our $DBGCURL = $CURL; #"../src/.libs/curl"; # alternative for debugging
our $valgrind_logfile = "--log-file"; # the option name for valgrind >=3
our $valgrind_tool = "--tool=memcheck";
our $gdb = checktestcmd("gdb");
our $gdbthis = 0; # run test case with debugger (gdb or lldb)
our $gdbxwin; # use windowed gdb when using gdb
@ -142,12 +142,12 @@ my %controllerw; # pipe that controller writes to
# redirected stdout/stderr to these files
sub stdoutfilename {
my ($logdir, $testnum)=@_;
my ($logdir, $testnum) = @_;
return "$logdir/stdout$testnum";
}
sub stderrfilename {
my ($logdir, $testnum)=@_;
my ($logdir, $testnum) = @_;
return "$logdir/stderr$testnum";
}
@ -157,19 +157,19 @@ sub stderrfilename {
# runnerac_* functions
# Called by controller
sub runner_init {
my ($logdir, $jobs)=@_;
my ($logdir, $jobs) = @_;
$multiprocess = !!$jobs;
# enable memory debugging if curl is compiled with it
$ENV{'CURL_MEMDEBUG'} = "$logdir/$MEMDUMP";
delete $ENV{'CURL_ENTROPY'} if($ENV{'CURL_ENTROPY'});
$ENV{'CURL_FORCETIME'}=1; # for debug NTLM magic
$ENV{'CURL_GLOBAL_INIT'}=1; # debug curl_global_init/cleanup use
$ENV{'HOME'}=$pwd;
$ENV{'CURL_HOME'}=$ENV{'HOME'};
$ENV{'XDG_CONFIG_HOME'}=$ENV{'HOME'};
$ENV{'COLUMNS'}=79; # screen width!
$ENV{'CURL_FORCETIME'} = 1; # for debug NTLM magic
$ENV{'CURL_GLOBAL_INIT'} = 1; # debug curl_global_init/cleanup use
$ENV{'HOME'} = $pwd;
$ENV{'CURL_HOME'} = $ENV{'HOME'};
$ENV{'XDG_CONFIG_HOME'} = $ENV{'HOME'};
$ENV{'COLUMNS'} = 79; # screen width!
# Incorporate the $logdir into the random seed and re-seed the PRNG.
# This gives each runner a unique yet consistent seed which provides
@ -262,8 +262,8 @@ sub event_loop {
# Check for a command in the PATH of the machine running curl.
#
sub checktestcmd {
my ($cmd)=@_;
my @testpaths=($LIBDIR . ".libs", $LIBDIR);
my ($cmd) = @_;
my @testpaths = ($LIBDIR . ".libs", $LIBDIR);
return checkcmd($cmd, @testpaths);
}
@ -452,7 +452,7 @@ sub torture {
logmsg " CMD: $testcmd\n" if($verbose);
# memanalyze -v is our friend, get the number of allocations made
my $count=0;
my $count = 0;
my @out = memanalyze("$LOGDIR/$MEMDUMP", 1, 0, 0);
for(@out) {
if(/^Operations: (\d+)/) {
@ -498,7 +498,7 @@ sub torture {
}
if($verbose) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime(time());
my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
logmsg "Fail function no: $limit at $now\r";
@ -550,16 +550,16 @@ sub torture {
# and does not core dump
if(($ret & 255) || ($ret >> 8) >= 128) {
logmsg " system() returned $ret\n";
$fail=1;
$fail = 1;
}
else {
my @memdata = memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 0);
my $leak=0;
my $leak = 0;
for(@memdata) {
if($_ ne "") {
# well it could be other memory problems as well, but
# we call it leak for short here
$leak=1;
$leak = 1;
}
}
if($leak) {
@ -753,9 +753,9 @@ sub singletest_prepare {
# create (possibly-empty) files before starting the test
for my $partsuffix (('', '1', '2', '3', '4')) {
my @inputfile=getpart("client", "file".$partsuffix);
my @inputfile = getpart("client", "file".$partsuffix);
my %fileattr = getpartattr("client", "file".$partsuffix);
my $filename=$fileattr{'name'};
my $filename = $fileattr{'name'};
if(@inputfile || $filename) {
if(!$filename) {
logmsg " $testnum: IGNORED: Section client=>file has no name attribute\n";
@ -812,25 +812,25 @@ sub singletest_run {
}
else {
# there was no command given, use something silly
$cmd="-";
$cmd = "-";
}
my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
my $CURLOUT = "$LOGDIR/curl$testnum.out"; # curl output if not stdout
# if stdout section exists, we verify that the stdout contained this:
my $out="";
my $out = "";
my %cmdhash = getpartattr("client", "command");
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
#We may slap on --output!
if(!partexists("verify", "stdout") ||
($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) {
$out=" --output $CURLOUT ";
$out = " --output $CURLOUT ";
}
}
my @codepieces = getpart("client", "tool");
my $tool="";
my $tool_name=""; # without exe extension
my $tool = "";
my $tool_name = ""; # without exe extension
if(@codepieces) {
$tool_name = $codepieces[0];
chomp $tool_name;
@ -839,27 +839,27 @@ sub singletest_run {
my $oldmemdebug;
my $disablevalgrind;
my $CMDLINE="";
my $CMDLINE = "";
my $cmdargs;
my $cmdtype = $cmdhash{'type'} || "default";
my $fail_due_event_based = $run_event_based;
if($cmdtype eq "perl") {
# run the command line prepended with "perl"
$cmdargs =$cmd;
$cmdargs = $cmd;
$CMDLINE = "$perl ";
$tool=$CMDLINE;
$disablevalgrind=1;
$tool = $CMDLINE;
$disablevalgrind = 1;
}
elsif($cmdtype eq "shell") {
# run the command line prepended with "/bin/sh"
$cmdargs =$cmd;
$cmdargs = $cmd;
$CMDLINE = "/bin/sh ";
$tool=$CMDLINE;
$disablevalgrind=1;
$tool = $CMDLINE;
$disablevalgrind = 1;
}
elsif(!$tool && !$keywords{"unittest"}) {
# run curl, add suitable command line options
my $inc="";
my $inc = "";
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-include/)) {
$inc = " --include";
}
@ -899,21 +899,21 @@ sub singletest_run {
# Default the tool to a unit test with the same name as the test spec
if($keywords{"unittest"} && !$tool) {
$tool_name="unit$testnum";
$tool_name = "unit$testnum";
$tool = $tool_name . exe_ext('TOOL');
}
if($tool =~ /^lib/) {
$tool = "libtests" . exe_ext('TOOL');
$CMDLINE=$LIBDIR . $tool;
$CMDLINE = $LIBDIR . $tool;
}
elsif($tool =~ /^tool/) {
$tool = "tunits" . exe_ext('TOOL');
$CMDLINE=$TUNITDIR . $tool;
$CMDLINE = $TUNITDIR . $tool;
}
elsif($tool =~ /^unit/) {
$tool = "units" . exe_ext('TOOL');
$CMDLINE=$UNITDIR . $tool;
$CMDLINE = $UNITDIR . $tool;
}
if(! -f $CMDLINE) {
@ -921,16 +921,16 @@ sub singletest_run {
return (-1, 0, 0, "", "", 0);
}
$CMDLINE=exerunner() . $CMDLINE;
$CMDLINE = exerunner() . $CMDLINE;
if($gdbthis) {
$cmdargs =" $tool_name$cmdargs";
$cmdargs = " $tool_name$cmdargs";
}
else {
$CMDLINE.=" $tool_name";
$CMDLINE .= " $tool_name";
}
$DBGCURL=$CMDLINE;
$DBGCURL = $CMDLINE;
}
if($fail_due_event_based) {
@ -942,13 +942,13 @@ sub singletest_run {
# gdb is incompatible with valgrind, so disable it when debugging
# Perhaps a better approach would be to run it under valgrind anyway
# with --db-attach=yes or --vgdb=yes.
$disablevalgrind=1;
$disablevalgrind = 1;
}
my @stdintest = getpart("client", "stdin");
if(@stdintest) {
my $stdinfile="$LOGDIR/stdin-for-$testnum";
my $stdinfile = "$LOGDIR/stdin-for-$testnum";
my %hash = getpartattr("client", "stdin");
if($hash{'nonewline'}) {
@ -966,7 +966,7 @@ sub singletest_run {
}
if(!$tool) {
$CMDLINE=exerunner() . shell_quote($CURL);
$CMDLINE = exerunner() . shell_quote($CURL);
if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-q/)) {
$CMDLINE .= " -q";
}
@ -1038,13 +1038,13 @@ sub singletest_run {
# gdb
my $GDBW = ($gdbxwin) ? "-w" : "";
runclient("$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " $GDBW -x $LOGDIR/gdbcmd");
$cmdres=0; # makes it always continue after a debugged run
$cmdres = 0; # makes it always continue after a debugged run
}
elsif($gdbthis == 2) {
# $gdb is "lldb"
print "runs lldb -- $CURL $cmdargs\n";
runclient("lldb -- $CURL $cmdargs");
$cmdres=0; # makes it always continue after a debugged run
$cmdres = 0; # makes it always continue after a debugged run
}
else {
# Convert the raw result code into a more useful one
@ -1065,7 +1065,7 @@ sub singletest_run {
#######################################################################
# Clean up after test command
sub singletest_clean {
my ($testnum, $dumped_core, $testtimings)=@_;
my ($testnum, $dumped_core, $testtimings) = @_;
if(!$dumped_core) {
if(-r "core") {
@ -1138,15 +1138,15 @@ sub singletest_clean {
#######################################################################
# Verify that the postcheck succeeded
sub singletest_postcheck {
my ($testnum)=@_;
my ($testnum) = @_;
# run the postcheck command
my @postcheck= getpart("client", "postcheck");
my @postcheck = getpart("client", "postcheck");
if(@postcheck) {
die "test$testnum uses client/postcheck";
}
@postcheck= getpart("verify", "postcheck");
@postcheck = getpart("verify", "postcheck");
if(@postcheck) {
my $cmd = join("", @postcheck);
chomp $cmd;
@ -1173,7 +1173,7 @@ sub singletest_postcheck {
###################################################################
# Get ready to run a single test case
sub runner_test_preprocess {
my ($testnum)=@_;
my ($testnum) = @_;
my %testtimings;
if(clearlogs()) {
@ -1233,7 +1233,7 @@ sub runner_test_preprocess {
# 1=unskippable test failure, as first integer, plus any log messages,
# plus more return values when error is 0
sub runner_test_run {
my ($testnum)=@_;
my ($testnum) = @_;
if(clearlogs()) {
logmsg "Warning: log messages were lost\n";
@ -1285,7 +1285,7 @@ sub runner_test_run {
# received.
# Called by controller
sub runnerac_shutdown {
my ($runnerid)=$_[0];
my ($runnerid) = $_[0];
my $err = controlleripccall(\&runner_shutdown, @_);
# These have no more use
@ -1362,7 +1362,7 @@ sub runnerar {
}
# system call was interrupted, probably by ^C; restart it so we stay in sync
}
my $len=unpack("L", $datalen);
my $len = unpack("L", $datalen);
my $buf;
while(! defined ($err = sysread($controllerr{$runnerid}, $buf, $len)) || $err <= 0) {
if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {
@ -1391,7 +1391,7 @@ sub runnerar_ready {
my ($blocking) = @_;
my $r_in = "";
my %idbyfileno;
my $maxfileno=0;
my $maxfileno = 0;
my @ready_runners = ();
foreach my $p (keys(%controllerr)) {
my $fd = fileno($controllerr{$p});
@ -1408,7 +1408,7 @@ sub runnerar_ready {
# caller will need to later call this function again.
# TODO: this is relatively slow with hundreds of fds
my $e_in = $r_in;
if(select(my $r_out=$r_in, undef, my $e_out=$e_in, $blocking) >= 1) {
if(select(my $r_out = $r_in, undef, my $e_out = $e_in, $blocking) >= 1) {
for my $fd (0..$maxfileno) {
# Return an error condition first in case it is both
if(vec($e_out, $fd, 1)) {
@ -1451,7 +1451,7 @@ sub ipcrecv {
}
# system call was interrupted, probably by ^C; restart it so we stay in sync
}
my $len=unpack("L", $datalen);
my $len = unpack("L", $datalen);
my $buf;
while(! defined ($err = sysread($runnerr, $buf, $len)) || $err <= 0) {
if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {

View file

@ -1899,7 +1899,7 @@ sub runsshserver {
!close($hostfile) ||
($SSHSRVMD5 !~ /^[a-f0-9]{32}$/i))
{
my $msg = "Fatal: $srvrname pubkey md5 missing : \"$hstpubmd5f\" : $!";
my $msg = "Fatal: $srvrname pubkey MD5 missing : \"$hstpubmd5f\" : $!";
logmsg "$msg\n";
stopservers($verb);
die $msg;
@ -1909,7 +1909,7 @@ sub runsshserver {
(read($hostfile, $SSHSRVSHA256, 48) == 0) ||
!close($hostfile))
{
my $msg = "Fatal: $srvrname pubkey sha256 missing : \"$hstpubsha256f\" : $!";
my $msg = "Fatal: $srvrname pubkey SHA256 missing : \"$hstpubsha256f\" : $!";
logmsg "$msg\n";
stopservers($verb);
die $msg;

View file

@ -446,21 +446,21 @@ if((! -e pp($hstprvkeyf)) || (! -s pp($hstprvkeyf)) ||
my @rsahostkey = do { local $/ = ' '; <$rsakeyfile> };
close($rsakeyfile);
if(!$rsahostkey[1]) {
logmsg "Failed parsing base64 encoded RSA host key\n";
logmsg "Failed parsing base64 encoded SSH host key\n";
exit 1;
}
open(my $pubmd5file, ">", pp($hstpubmd5f));
print $pubmd5file md5_hex(decode_base64($rsahostkey[1]));
close($pubmd5file);
if((! -e pp($hstpubmd5f)) || (! -s pp($hstpubmd5f))) {
logmsg "Failed writing md5 hash of RSA host key\n";
logmsg "Failed writing MD5 hash of SSH host key\n";
exit 1;
}
open(my $pubsha256file, ">", pp($hstpubsha256f));
print $pubsha256file sha256_base64(decode_base64($rsahostkey[1]));
close($pubsha256file);
if((! -e pp($hstpubsha256f)) || (! -s pp($hstpubsha256f))) {
logmsg "Failed writing sha256 hash of RSA host key\n";
logmsg "Failed writing SHA256 hash of SSH host key\n";
exit 1;
}
}

View file

@ -81,7 +81,7 @@ sub scanenum {
sub scanheader {
my ($f)=@_;
open my $h, "<", $f;
open(my $h, "<", $f);
while(<$h>) {
if(/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) {
push @syms, $1;
@ -120,7 +120,7 @@ sub checkmanpage {
my $s = $1;
# skip two "special" ones
if($s !~ /(^(CURLE_OBSOLETE|CURLOPT_TEMPLATE))|_$/) {
push @manrefs, "$1:$m:$line";
push @manrefs, "$s:$m:$line";
}
}
$line++;
@ -143,7 +143,7 @@ scanallheaders();
scanman_md_dir("$root/docs/libcurl");
scanman_md_dir("$root/docs/libcurl/opts");
open my $s, "<", "$root/docs/libcurl/symbols-in-versions";
open(my $s, "<", "$root/docs/libcurl/symbols-in-versions");
while(<$s>) {
if(/(^[^ \n]+) +(.*)/) {
my ($sym, $rest)=($1, $2);

View file

@ -119,7 +119,7 @@ sub scanenums {
sub scanheader {
my ($f)=@_;
scanenums($f);
open H, "<$f";
open(H, '<', $f);
while(<H>) {
my ($line, $linenum) = ($_, $.);
if(/^ *# *define +([^ \n]*)/) {

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "tool_getparam.h"
static CURLcode test_tool1394(const char *arg)

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#if defined(_WIN32) || defined(MSDOS)
#include "tool_cfgable.h"
#include "tool_doswin.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "tool_xattr.h"
static CURLcode test_tool1621(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "tool_progress.h"
static CURLcode test_tool1622(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "tool_getparam.h"
struct check1623 {

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "llist.h"
static void test_Curl_llist_dtor(void *key, void *value)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "url.h" /* for curlx_safefree */

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "connect.h"
@ -50,10 +49,10 @@ static void t1303_stop(struct Curl_easy *easy)
#define BASE 1000000
/* macro to set the pretended current time */
#define NOW(x,y) now.tv_sec = x; now.tv_usec = y
#define NOW(x, y) now.tv_sec = x; now.tv_usec = y
/* macro to set the millisecond based timeouts to use */
#define TIMEOUTS(x,y) easy->set.timeout = x; \
easy->set.connecttimeout = y
#define TIMEOUTS(x, y) easy->set.timeout = x; \
easy->set.connecttimeout = y
/*
* To test:

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#ifndef CURL_DISABLE_NETRC
#include "netrc.h"
static void t1304_stop(char **password, char **login)

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#ifndef CURL_DISABLE_FTP
#include "curl_fnmatch.h"
/*

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "splay.h"
static void splayprint(struct Curl_tree *t, int d, char output)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "vtls/hostcheck.h"
static CURLcode test_unit1397(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "progress.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "curl_ntlm_core.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "curl_md5.h"
static CURLcode test_unit1601(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "hash.h"
static void t1602_mydtor(void *p)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "hash.h"
static const size_t slots = 3;

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "llist.h"
static CURLcode t1605_setup(CURL **easy)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "connect.h"
#include "curl_addrinfo.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "connect.h"
#include "curl_addrinfo.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "curl_sha256.h"
static CURLcode t1610_setup(void)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "curl_md4.h"
static CURLcode test_unit1611(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "curl_hmac.h"
#include "curl_md5.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "noproxy.h"
static CURLcode test_unit1614(const char *arg)

View file

@ -23,7 +23,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "curl_sha512_256.h"
static CURLcode test_unit1615(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "url.h"

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
#include "urldata.h"
#include "url.h"
@ -126,8 +125,7 @@ static CURLcode test_unit1625(const char *arg)
return CURLE_OK;
}
#else
/* for HTTP-disabled builds */
#else /* CURL_DISABLE_HTTP */
static CURLcode test_unit1625(const char *arg)
{
(void)arg;

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
#include "urldata.h"
#include "url.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "url.h"
#include "strcase.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "vtls/x509asn1.h"
static CURLcode test_unit1651(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "curl_trc.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "altsvc.h"

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
#include "vtls/x509asn1.h"
struct test_spec {

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
#include "vtls/x509asn1.h"
struct test1657_spec {

View file

@ -25,7 +25,6 @@
/* DoH + HTTPSRR are required */
#if !defined(CURL_DISABLE_DOH) && defined(USE_HTTPSRR)
#include "doh.h"
#include "httpsrr.h"

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HSTS)
#include "urldata.h"
#include "hsts.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "bufq.h"
#include "curl_trc.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "dynhds.h"
#include "curl_trc.h"

View file

@ -24,7 +24,6 @@
#include "unitcheck.h"
#ifndef CURL_DISABLE_HTTP
#include "urldata.h"
#include "http1.h"
#include "curl_trc.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "vtls/cipher_suite.h"
static CURLcode test_unit3205(const char *arg)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "uint-table.h"
#include "curl_trc.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
#include "uint-spbset.h"
#include "curl_trc.h"

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "urldata.h"
static void checksize(const char *name, size_t size, size_t allowed)

View file

@ -22,7 +22,6 @@
*
***************************************************************************/
#include "unitcheck.h"
#include "ratelimit.h"
static CURLcode test_unit3216(const char *arg)