aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-07-17 14:32:19 +0000
committerYang Tse <yangsita@gmail.com>2006-07-17 14:32:19 +0000
commit773bec5ae5b7a7fe4ef8c4c0e75b8872c5b4da69 (patch)
tree71d135202766275fa87dab9ab2080da172ff69c9 /tests/libtest
parentf3c508f6e8b98ac601fbe2ad7312c2d70d3b4714 (diff)
Fix compiler warning "enumerated type mixed with another type"
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib506.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c
index 52a4094a2..ecf17fa22 100644
--- a/tests/libtest/lib506.c
+++ b/tests/libtest/lib506.c
@@ -130,7 +130,7 @@ char *suburl(char *base, int i)
int test(char *URL)
{
int res;
- CURLSHcode scode;
+ CURLSHcode scode = CURLSHE_OK;
char *url;
struct Tdata tdata;
CURL *curl;
@@ -148,15 +148,29 @@ int test(char *URL)
/* prepare share */
printf( "SHARE_INIT\n" );
share = curl_share_init();
- scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, lock);
- scode += curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, unlock);
- scode += curl_share_setopt( share, CURLSHOPT_USERDATA, &user);
- printf( "CURL_LOCK_DATA_COOKIE\n" );
- scode += curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
- printf( "CURL_LOCK_DATA_DNS\n" );
- scode += curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
-
- if(scode) {
+
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_LOCKFUNC\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_LOCKFUNC, lock);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_UNLOCKFUNC\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_UNLOCKFUNC, unlock);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURLSHOPT_USERDATA\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_USERDATA, &user);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURL_LOCK_DATA_COOKIE\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
+ }
+ if ( CURLSHE_OK == scode ) {
+ printf( "CURL_LOCK_DATA_DNS\n" );
+ scode = curl_share_setopt( share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
+ }
+
+ if ( CURLSHE_OK != scode ) {
curl_share_cleanup(share);
return 2;
}