[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 69/208: test1521: fix compiler warnings
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 69/208: test1521: fix compiler warnings |
Date: |
Wed, 09 Aug 2017 17:34:26 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.55.0
in repository gnurl.
commit e8a4da67f5d041f6fac0a1fea20d58bf5f151691
Author: Marcel Raad <address@hidden>
AuthorDate: Sat Jun 24 16:39:27 2017 +0200
test1521: fix compiler warnings
The integer literal 3123123123 doesn't fit into a 32-bit signed
integer, so GCC with 32-bit long warns in C90 mode:
this decimal constant is unsigned only in ISO C90 [enabled by default]
Fix this by using ULONG_MAX, which should fit in any curl_off_t and has
the correct suffix to not issue any warnings.
Also adds the missing CURLOPT_REQUEST_TARGET from commit
9b167fd090f596eac828817d48c247eeae53407f.
Closes https://github.com/curl/curl/pull/1611
---
tests/libtest/lib1521.c | 21 +++++++++++++--------
tests/libtest/mk-lib1521.pl | 7 ++++---
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/tests/libtest/lib1521.c b/tests/libtest/lib1521.c
index 27a380064..e6512a4dd 100644
--- a/tests/libtest/lib1521.c
+++ b/tests/libtest/lib1521.c
@@ -31,9 +31,8 @@ struct data {
#define LO LONG_MIN
#define HI LONG_MAX
-#define OFF_VAL (curl_off_t) 3123123123
#define OFF_LO (curl_off_t) LO
-#define OFF_HI (curl_off_t) HI
+#define OFF_HI (curl_off_t) ULONG_MAX
#define OFF_NO (curl_off_t) 0
/* Unexpected error.
@@ -1097,7 +1096,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, OFF_NO);
if(UNEX(res)) {
err("INFILESIZE_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, OFF_HI);
if(UNEX(res)) {
err("INFILESIZE_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, OFF_LO);
@@ -1106,7 +1105,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, OFF_NO);
if(UNEX(res)) {
err("RESUME_FROM_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, OFF_HI);
if(UNEX(res)) {
err("RESUME_FROM_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, OFF_LO);
@@ -1115,7 +1114,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, OFF_NO);
if(UNEX(res)) {
err("MAXFILESIZE_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, OFF_HI);
if(UNEX(res)) {
err("MAXFILESIZE_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, OFF_LO);
@@ -1142,7 +1141,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, OFF_NO);
if(UNEX(res)) {
err("POSTFIELDSIZE_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, OFF_HI);
if(UNEX(res)) {
err("POSTFIELDSIZE_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, OFF_LO);
@@ -1293,7 +1292,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, OFF_NO);
if(UNEX(res)) {
err("MAX_SEND_SPEED_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, OFF_HI);
if(UNEX(res)) {
err("MAX_SEND_SPEED_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, OFF_LO);
@@ -1302,7 +1301,7 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, OFF_NO);
if(UNEX(res)) {
err("MAX_RECV_SPEED_LARGE", res, __LINE__); goto test_cleanup; }
- res = curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, OFF_VAL);
+ res = curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, OFF_HI);
if(UNEX(res)) {
err("MAX_RECV_SPEED_LARGE", res, __LINE__); goto test_cleanup; }
res = curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, OFF_LO);
@@ -2315,6 +2314,12 @@ int test(char *URL)
res = curl_easy_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS, HI);
if(UNEX(res)) {
err("SUPPRESS_CONNECT_HEADERS", res, __LINE__); goto test_cleanup; }
+ res = curl_easy_setopt(curl, CURLOPT_REQUEST_TARGET, "string");
+ if(UNEX(res)) {
+ err("REQUEST_TARGET", res, __LINE__); goto test_cleanup; }
+ res = curl_easy_setopt(curl, CURLOPT_REQUEST_TARGET, NULL);
+ if(UNEX(res)) {
+ err("REQUEST_TARGET", res, __LINE__); goto test_cleanup; }
res = curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &charp);
if(UNEX(res)) {
geterr("EFFECTIVE_URL", res, __LINE__); goto test_cleanup; }
diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl
index d59db0d7a..e60bce5cc 100644
--- a/tests/libtest/mk-lib1521.pl
+++ b/tests/libtest/mk-lib1521.pl
@@ -27,6 +27,8 @@
# minimum and maximum long signed values
my $minlong = "LONG_MIN";
my $maxlong = "LONG_MAX";
+# maximum long unsigned value
+my $maxulong = "ULONG_MAX";
print <<HEADER
/***************************************************************************
@@ -62,9 +64,8 @@ struct data {
#define LO $minlong
#define HI $maxlong
-#define OFF_VAL (curl_off_t) 3123123123
#define OFF_LO (curl_off_t) LO
-#define OFF_HI (curl_off_t) HI
+#define OFF_HI (curl_off_t) $maxulong
#define OFF_NO (curl_off_t) 0
/* Unexpected error.
@@ -235,7 +236,7 @@ while(<STDIN>) {
elsif($type eq "OFF_T") {
# play conservative to work with 32bit curl_off_t
print "${pref} OFF_NO);\n$check";
- print "${pref} OFF_VAL);\n$check";
+ print "${pref} OFF_HI);\n$check";
print "${pref} OFF_LO);\n$check";
}
else {
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 51/208: travis: do the distcheck test build out-of-tree as well, (continued)
- [GNUnet-SVN] [gnurl] 51/208: travis: do the distcheck test build out-of-tree as well, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 43/208: PIPELINING_SERVER_BL: cleanup the internal list use, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 37/208: TODO: implement support for CURLOPT_PREQUOTE with SFTP, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 73/208: socks: use proxy_user instead of proxy_name, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 70/208: test1537: fixed memory leak on OOM, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 22/208: url: refactor the check for Windows drive letter in path, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 54/208: ci: whitelist branches to avoid testing feature branches twice, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 49/208: test1521: test getinfo's OFF_T types too, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 29/208: http-proxy: fix chunked-encoded CONNECT responses, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 74/208: socks: deduplicate the code for auth request, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 69/208: test1521: fix compiler warnings,
gnunet <=
- [GNUnet-SVN] [gnurl] 44/208: getinfo: return sizes as curl_off_t, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 31/208: curl-compilers.m4: enable double-promotion warning, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 50/208: http: add --strip-path-slash and CURLOPT_STRIP_PATH_SLASH, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 35/208: curl: prevent binary output spewed to terminal, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 86/208: make: build the docs subdir only from within src, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 84/208: test1450: add simple testing for DICT, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 99/208: configure: try ldap/lber in reversed order first, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 93/208: tool_sleep: typecast to avoid macos compiler warning, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 97/208: dist: add SMB python deps into the tarball, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 104/208: cmake: fix send/recv argument scanner for windows, gnunet, 2017/08/09