test1175: verify symbols-in-versions and libcurl-errors.3 in sync

Closes #4628
This commit is contained in:
Daniel Stenberg 2019-11-21 14:54:37 +01:00
Родитель f70da9c17e
Коммит 74f441c6d3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
5 изменённых файлов: 118 добавлений и 10 удалений

Просмотреть файл

@ -59,9 +59,9 @@ Couldn't resolve proxy. The given proxy host could not be resolved.
Couldn't resolve host. The given remote host was not resolved.
.IP "CURLE_COULDNT_CONNECT (7)"
Failed to connect() to host or proxy.
.IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
The server sent data libcurl couldn't parse. This error code is used for more
than just FTP and is aliased as \fICURLE_WEIRD_SERVER_REPLY\fP since 7.51.0.
.IP "CURLE_WEIRD_SERVER_REPLY (8)"
The server sent data libcurl couldn't parse. This error code was known as as
\fICURLE_FTP_WEIRD_SERVER_REPLY\fP before 7.51.0.
.IP "CURLE_REMOTE_ACCESS_DENIED (9)"
We were denied access to the resource given in the URL. For FTP, this occurs
while trying to change to the remote directory.
@ -271,6 +271,9 @@ This is not really an error. It means you should call
between. Before version 7.20.0 this could be returned by
\fIcurl_multi_perform(3)\fP, but in later versions this return code is never
used.
.IP "CURLM_CALL_MULTI_SOCKET (-1)"
An alias for CURLM_CALL_MULTI_PERFORM. Never returned by modern libcurl
versions.
.IP "CURLM_OK (0)"
Things are fine.
.IP "CURLM_BAD_HANDLE (1)"

Просмотреть файл

@ -38,7 +38,7 @@ CURLCLOSEPOLICY_OLDEST 7.7
CURLCLOSEPOLICY_SLOWEST 7.7
CURLE_ABORTED_BY_CALLBACK 7.1
CURLE_AGAIN 7.18.2
CURLE_ALREADY_COMPLETE 7.7.2
CURLE_ALREADY_COMPLETE 7.7.2 7.8
CURLE_AUTH_ERROR 7.66.0
CURLE_BAD_CALLING_ORDER 7.1 7.17.0
CURLE_BAD_CONTENT_ENCODING 7.10
@ -56,7 +56,7 @@ CURLE_FILESIZE_EXCEEDED 7.10.8
CURLE_FILE_COULDNT_READ_FILE 7.1
CURLE_FTP_ACCEPT_FAILED 7.24.0
CURLE_FTP_ACCEPT_TIMEOUT 7.24.0
CURLE_FTP_ACCESS_DENIED 7.1
CURLE_FTP_ACCESS_DENIED 7.1 7.17.0
CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1
CURLE_FTP_BAD_FILE_LIST 7.21.0
CURLE_FTP_CANT_GET_HOST 7.1
@ -66,7 +66,7 @@ CURLE_FTP_COULDNT_RETR_FILE 7.1
CURLE_FTP_COULDNT_SET_ASCII 7.1 7.17.0
CURLE_FTP_COULDNT_SET_BINARY 7.1 7.17.0
CURLE_FTP_COULDNT_SET_TYPE 7.17.0
CURLE_FTP_COULDNT_STOR_FILE 7.1
CURLE_FTP_COULDNT_STOR_FILE 7.1 7.16.3
CURLE_FTP_COULDNT_USE_REST 7.1
CURLE_FTP_PARTIAL_FILE 7.1 7.1
CURLE_FTP_PORT_FAILED 7.1
@ -77,7 +77,7 @@ CURLE_FTP_USER_PASSWORD_INCORRECT 7.1 7.17.0
CURLE_FTP_WEIRD_227_FORMAT 7.1
CURLE_FTP_WEIRD_PASS_REPLY 7.1
CURLE_FTP_WEIRD_PASV_REPLY 7.1
CURLE_FTP_WEIRD_SERVER_REPLY 7.1
CURLE_FTP_WEIRD_SERVER_REPLY 7.1 7.51.0
CURLE_FTP_WEIRD_USER_REPLY 7.1 7.17.0
CURLE_FTP_WRITE_ERROR 7.1 7.17.0
CURLE_FUNCTION_NOT_FOUND 7.1
@ -85,7 +85,7 @@ CURLE_GOT_NOTHING 7.9.1
CURLE_HTTP2 7.38.0
CURLE_HTTP2_STREAM 7.49.0
CURLE_HTTP3 7.68.0
CURLE_HTTP_NOT_FOUND 7.1
CURLE_HTTP_NOT_FOUND 7.1 7.10.3
CURLE_HTTP_PORT_FAILED 7.3 7.12.0
CURLE_HTTP_POST_ERROR 7.1
CURLE_HTTP_RANGE_ERROR 7.1 7.17.0
@ -144,7 +144,7 @@ CURLE_TFTP_PERM 7.15.0
CURLE_TFTP_UNKNOWNID 7.15.0
CURLE_TOO_MANY_REDIRECTS 7.5
CURLE_UNKNOWN_OPTION 7.21.5
CURLE_UNKNOWN_TELNET_OPTION 7.7
CURLE_UNKNOWN_TELNET_OPTION 7.7 7.21.5
CURLE_UNSUPPORTED_PROTOCOL 7.1
CURLE_UPLOAD_FAILED 7.16.3
CURLE_URL_MALFORMAT 7.1

Просмотреть файл

@ -133,7 +133,7 @@ test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \
test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \
test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \
test1160 test1161 test1162 test1163 test1164 test1165 test1166 \
test1170 test1171 test1172 test1173 test1174 \
test1170 test1171 test1172 test1173 test1174 test1175 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \

25
tests/data/test1175 Normal file
Просмотреть файл

@ -0,0 +1,25 @@
<testcase>
<info>
<keywords>
source analysis
symbols-in-versions
</keywords>
</info>
#
# Client-side
<client>
<server>
none
</server>
<name>
Verify that symbols-in-versions and libcurl-errors.3 are in sync
</name>
<command type="perl">
%SRCDIR/error-codes.pl %SRCDIR
</command>
</client>
</testcase>

80
tests/error-codes.pl Normal file
Просмотреть файл

@ -0,0 +1,80 @@
#!/usr/bin/env perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2010-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
# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
###########################################################################
#
#
use strict;
use warnings;
# we may get the dir root pointed out
my $root=$ARGV[0] || ".";
my %error; # from the include file
my %docs; # from libcurl-errors.3
sub getdocserrors {
open(F, "<$root/docs/libcurl/libcurl-errors.3");
while(<F>) {
if($_ =~ /^.IP \"(CURL[EM]_[^ \t\"]*)/) {
my ($symbol) = ($1);
if($symbol =~ /OBSOLETE/) {
;
}
else {
$docs{$symbol}=1;
}
}
}
close(F);
}
sub getincludeerrors {
open(F, "<$root/docs/libcurl/symbols-in-versions");
while(<F>) {
if($_ =~ /^(CURL[EM]_[^ \t]*)[ \t]*([0-9.]+)[ \t]*(.*)/) {
my ($symbol, $added, $rest) = ($1,$2,$3);
if($rest =~ /^([0-9.]+)/) {
# removed!
}
else {
$error{$symbol}=$added;
}
}
}
close(F);
}
getincludeerrors();
getdocserrors();
for(sort keys %error) {
if($error{$_} && !$docs{$_}) {
print "$_ is not in libcurl-errors.3\n";
}
}
for(sort keys %docs) {
if($docs{$_} && !$error{$_}) {
print "$_ is not in symbols-in-versions\n";
}
}