mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:43:38 +03:00
test1538: verify the libcurl strerror API calls
This commit is contained in:
parent
4ba20a5119
commit
cef9c9e782
4 changed files with 205 additions and 2 deletions
|
|
@ -24,7 +24,7 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect \
|
|||
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
|
||||
lib1520 \
|
||||
lib1525 lib1526 lib1527 lib1528 lib1529 lib1530 lib1531 lib1532 lib1533 \
|
||||
lib1534 lib1535 lib1536 lib1537 \
|
||||
lib1534 lib1535 lib1536 lib1537 lib1538 \
|
||||
lib1540 lib1541 \
|
||||
lib1900 \
|
||||
lib2033
|
||||
|
|
@ -420,6 +420,10 @@ lib1537_SOURCES = lib1537.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
|||
lib1537_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1537_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
lib1538_SOURCES = lib1538.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1538_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1538_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
lib1540_SOURCES = lib1540.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1540_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1540_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
|
|
|||
51
tests/libtest/lib1538.c
Normal file
51
tests/libtest/lib1538.c
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "test.h"
|
||||
|
||||
#include "memdebug.h"
|
||||
|
||||
int test(char *URL)
|
||||
{
|
||||
int res = 0;
|
||||
CURLcode easyret;
|
||||
CURLMcode multiret;
|
||||
CURLSHcode shareret;
|
||||
(void)URL;
|
||||
|
||||
curl_easy_strerror(INT_MAX);
|
||||
curl_multi_strerror(INT_MAX);
|
||||
curl_share_strerror(INT_MAX);
|
||||
curl_easy_strerror(-INT_MAX);
|
||||
curl_multi_strerror(-INT_MAX);
|
||||
curl_share_strerror(-INT_MAX);
|
||||
for(easyret=CURLE_OK; easyret <= CURL_LAST; easyret++) {
|
||||
printf("e%d: %s\n", (int)easyret, curl_easy_strerror(easyret));
|
||||
}
|
||||
for(multiret=CURLM_CALL_MULTI_PERFORM; multiret <= CURLM_LAST; multiret++) {
|
||||
printf("m%d: %s\n", (int)multiret, curl_multi_strerror(multiret));
|
||||
}
|
||||
for(shareret=CURLSHE_OK; shareret <= CURLSHE_LAST; shareret++) {
|
||||
printf("s%d: %s\n", (int)shareret, curl_share_strerror(shareret));
|
||||
}
|
||||
|
||||
return (int)res;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue