diff options
Diffstat (limited to 'tests/libtest')
70 files changed, 1439 insertions, 636 deletions
diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index 653e5315d..896686bd8 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -65,8 +65,7 @@ endforeach() # lib547 # #lib548 # lib549 lib552 lib553 lib554 lib555 lib556 -# lib539 lib557 lib558 -# #lib559 +# lib539 lib557 # lib560 # ) @@ -120,8 +119,3 @@ endforeach() # SET(SOURCE "lib547.c" ${SUPPORTFILES}) # ADD_TESTUTIL_IF_NECESSARY(${TEST_NAME}) # SETUP_TEST(${TEST_NAME} ${SOURCE}) - -# SET(TEST_NAME lib559) -# SET(SOURCE "lib558.c" ${SUPPORTFILES}) -# ADD_TESTUTIL_IF_NECESSARY(${TEST_NAME}) -# SETUP_TEST(${TEST_NAME} ${SOURCE}) diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc index 2354ecc60..a210cbfe3 100644 --- a/tests/libtest/Makefile.inc +++ b/tests/libtest/Makefile.inc @@ -5,14 +5,14 @@ TESTUTIL = testutil.c testutil.h SUPPORTFILES = first.c test.h # These are all libcurl test programs -noinst_PROGRAMS = lib500 lib501 lib502 lib503 lib504 lib505 lib506 \ - lib507 lib508 lib510 lib511 lib512 lib513 lib514 lib515 lib516 \ - lib517 lib518 lib519 lib520 lib521 lib523 lib524 lib525 lib526 lib527 \ - lib574 lib575 lib576 lib577 lib578 lib579 \ - lib529 lib530 lib532 lib533 lib536 lib537 lib540 lib541 lib542 lib543 \ - lib544 lib545 lib547 lib548 lib549 lib552 lib553 lib554 lib555 lib556 \ - lib539 lib557 lib558 lib559 lib560 lib562 lib564 lib565 lib566 lib567 \ - lib568 lib569 lib570 lib571 lib572 lib573 chkhostname +noinst_PROGRAMS = chkhostname \ + lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 lib508 lib510 \ + lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib518 lib519 lib520 \ + lib521 lib523 lib524 lib525 lib526 lib527 lib574 lib575 lib576 lib578 \ + lib579 lib529 lib530 lib532 lib533 lib536 lib537 lib540 lib541 lib542 \ + lib543 lib544 lib545 lib547 lib548 lib549 lib552 lib553 lib554 lib555 \ + lib556 lib539 lib557 lib560 lib562 lib564 lib565 lib566 lib567 lib568 \ + lib569 lib570 lib571 lib572 lib573 lib582 lib583 chkhostname_SOURCES = chkhostname.c $(top_srcdir)/lib/curl_gethostname.c chkhostname_LDADD = @CURL_NETWORK_LIBS@ @@ -122,12 +122,6 @@ lib556_SOURCES = lib556.c $(SUPPORTFILES) lib557_SOURCES = lib557.c $(SUPPORTFILES) -lib558_SOURCES = lib558.c $(SUPPORTFILES) -lib558_CFLAGS = -DLIB558 - -lib559_SOURCES = lib558.c $(SUPPORTFILES) -lib559_CFLAGS = -DLIB559 - lib560_SOURCES = lib560.c $(SUPPORTFILES) lib574_SOURCES = lib574.c $(SUPPORTFILES) @@ -136,8 +130,6 @@ lib575_SOURCES = lib575.c $(SUPPORTFILES) lib576_SOURCES = lib576.c $(SUPPORTFILES) -lib577_SOURCES = lib577.c $(SUPPORTFILES) - lib562_SOURCES = lib562.c $(SUPPORTFILES) lib564_SOURCES = lib564.c $(SUPPORTFILES) $(TESTUTIL) @@ -165,3 +157,6 @@ lib578_SOURCES = lib578.c $(SUPPORTFILES) lib579_SOURCES = lib579.c $(SUPPORTFILES) +lib582_SOURCES = lib582.c $(SUPPORTFILES) $(TESTUTIL) + +lib583_SOURCES = lib583.c $(SUPPORTFILES) diff --git a/tests/libtest/chkhostname.c b/tests/libtest/chkhostname.c index 72c8b6a1f..58930467f 100644 --- a/tests/libtest/chkhostname.c +++ b/tests/libtest/chkhostname.c @@ -1,3 +1,24 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2011, 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 http://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 "setup.h" #include "curl_gethostname.h" diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 53b372ba5..a6f8e3cc2 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_LOCALE_H diff --git a/tests/libtest/lib500.c b/tests/libtest/lib500.c index dc6967cbe..b88bfd8bc 100644 --- a/tests/libtest/lib500.c +++ b/tests/libtest/lib500.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib501.c b/tests/libtest/lib501.c index 770cf8f74..26275f977 100644 --- a/tests/libtest/lib501.c +++ b/tests/libtest/lib501.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c index f6be5aaf7..9ade12afb 100644 --- a/tests/libtest/lib502.c +++ b/tests/libtest/lib502.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 "testutil.h" diff --git a/tests/libtest/lib503.c b/tests/libtest/lib503.c index 2301186af..d6ef58a00 100644 --- a/tests/libtest/lib503.c +++ b/tests/libtest/lib503.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 <sys/types.h> diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c index b8091f66a..55ad5ff31 100644 --- a/tests/libtest/lib504.c +++ b/tests/libtest/lib504.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 <sys/types.h> diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index 5af7ac0bb..0a255d673 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_SOCKET_H diff --git a/tests/libtest/lib506.c b/tests/libtest/lib506.c index 9209056dd..6476b9546 100644 --- a/tests/libtest/lib506.c +++ b/tests/libtest/lib506.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 <stdlib.h> #include <ctype.h> diff --git a/tests/libtest/lib507.c b/tests/libtest/lib507.c index 012d8f454..a52fabec1 100644 --- a/tests/libtest/lib507.c +++ b/tests/libtest/lib507.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 "testutil.h" diff --git a/tests/libtest/lib508.c b/tests/libtest/lib508.c index 0fa5eb9d2..1aca064e9 100644 --- a/tests/libtest/lib508.c +++ b/tests/libtest/lib508.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index f3f8cdbc0..779164ad5 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib511.c b/tests/libtest/lib511.c index dea97c5e2..6be2d2f76 100644 --- a/tests/libtest/lib511.c +++ b/tests/libtest/lib511.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib512.c b/tests/libtest/lib512.c index 9f59f7baf..19da18b4f 100644 --- a/tests/libtest/lib512.c +++ b/tests/libtest/lib512.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib513.c b/tests/libtest/lib513.c index c85006e1d..c013ac258 100644 --- a/tests/libtest/lib513.c +++ b/tests/libtest/lib513.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib514.c b/tests/libtest/lib514.c index 283f89e4b..953e90dff 100644 --- a/tests/libtest/lib514.c +++ b/tests/libtest/lib514.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib515.c b/tests/libtest/lib515.c index 2660ae369..4e96c4a8d 100644 --- a/tests/libtest/lib515.c +++ b/tests/libtest/lib515.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib516.c b/tests/libtest/lib516.c index b796dbbb7..a9590948d 100644 --- a/tests/libtest/lib516.c +++ b/tests/libtest/lib516.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c index 38a65d30b..9e0a91f16 100644 --- a/tests/libtest/lib517.c +++ b/tests/libtest/lib517.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index 9e683d956..c483d7ade 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_TYPES_H diff --git a/tests/libtest/lib519.c b/tests/libtest/lib519.c index f885c5de6..b720c8fee 100644 --- a/tests/libtest/lib519.c +++ b/tests/libtest/lib519.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib520.c b/tests/libtest/lib520.c index a0e124489..9ffaa4f92 100644 --- a/tests/libtest/lib520.c +++ b/tests/libtest/lib520.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib521.c b/tests/libtest/lib521.c index 9e79cb41e..93c306864 100644 --- a/tests/libtest/lib521.c +++ b/tests/libtest/lib521.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib523.c b/tests/libtest/lib523.c index a1ac4a4e9..0fdc83db6 100644 --- a/tests/libtest/lib523.c +++ b/tests/libtest/lib523.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib524.c b/tests/libtest/lib524.c index ee520628b..6f56df9b0 100644 --- a/tests/libtest/lib524.c +++ b/tests/libtest/lib524.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index ade637012..2765897fd 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 <sys/types.h> diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c index 0418b6ba2..27b87bdd8 100644 --- a/tests/libtest/lib526.c +++ b/tests/libtest/lib526.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ /* * This code sets up multiple easy handles that transfer a single file from * the same URL, in a serial manner after each other. Due to the connection diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c index abefc92d3..2ec67f61b 100644 --- a/tests/libtest/lib530.c +++ b/tests/libtest/lib530.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_TYPES_H diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c index 89ac7bf89..62ce2cdb9 100644 --- a/tests/libtest/lib533.c +++ b/tests/libtest/lib533.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ /* used for test case 533, 534 and 535 */ #include "test.h" diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index e0c19f661..6e3e7571c 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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 <sys/types.h> diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index 842dbab77..97119129b 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_TYPES_H diff --git a/tests/libtest/lib539.c b/tests/libtest/lib539.c index 9909d01d1..923893fb2 100644 --- a/tests/libtest/lib539.c +++ b/tests/libtest/lib539.c @@ -1,12 +1,24 @@ -/***************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - */ - +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index bf4cd5225..32d2342d5 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -1,12 +1,25 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * This is the 'proxyauth.c' test app posted by Shmulik Regev on the libcurl + * 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 http://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. + * + ***************************************************************************/ +/* This is the 'proxyauth.c' test app posted by Shmulik Regev on the libcurl * mailing list on 10 Jul 2007, converted to a test case. * * argv1 = URL diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c index 2fc85b97d..6af7bc5cf 100644 --- a/tests/libtest/lib541.c +++ b/tests/libtest/lib541.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_SOCKET_H diff --git a/tests/libtest/lib542.c b/tests/libtest/lib542.c index ef7b483b4..efe8ea24e 100644 --- a/tests/libtest/lib542.c +++ b/tests/libtest/lib542.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" #ifdef HAVE_SYS_SOCKET_H diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c index 8f14f8411..08d9c4544 100644 --- a/tests/libtest/lib543.c +++ b/tests/libtest/lib543.c @@ -1,13 +1,25 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * Based on Alex Fishman's bug report on September 30, 2007 - */ + * 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 http://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. + * + ***************************************************************************/ +/* Based on Alex Fishman's bug report on September 30, 2007 */ #include "test.h" diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index 6bc899cc5..b766187f2 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 4ef303726..c82bc3f23 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -1,12 +1,25 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * argv1 = URL + * 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 http://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. + * + ***************************************************************************/ +/* argv1 = URL * argv2 = proxy * argv3 = proxyuser:password */ diff --git a/tests/libtest/lib549.c b/tests/libtest/lib549.c index 9fd18b225..a1568c88f 100644 --- a/tests/libtest/lib549.c +++ b/tests/libtest/lib549.c @@ -1,12 +1,25 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * argv1 = URL + * 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 http://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. + * + ***************************************************************************/ +/* argv1 = URL * argv2 = proxy * argv3 = non-zero means ASCII transfer */ diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index eeecf6f91..fb8b14bc2 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -1,12 +1,25 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * argv1 = URL + * 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 http://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. + * + ***************************************************************************/ +/* argv1 = URL * argv2 = proxy with embedded user+password */ diff --git a/tests/libtest/lib553.c b/tests/libtest/lib553.c index 8694daf67..cb1cefd5e 100644 --- a/tests/libtest/lib553.c +++ b/tests/libtest/lib553.c @@ -1,12 +1,26 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * This test case and code is based on the bug recipe Joe Malicki provided for + * 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 http://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. + * + ***************************************************************************/ + +/* This test case and code is based on the bug recipe Joe Malicki provided for * bug report #1871269, fixed on Jan 14 2008 before the 7.18.0 release. */ diff --git a/tests/libtest/lib554.c b/tests/libtest/lib554.c index d7c68241a..d510268e7 100644 --- a/tests/libtest/lib554.c +++ b/tests/libtest/lib554.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index 55b3f13ed..c67501521 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -1,12 +1,26 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * - * This test case is supposed to be identical to 547 except that this uses the + * 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 http://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. + * + ***************************************************************************/ + +/* This test case is supposed to be identical to 547 except that this uses the * multi interface and 547 is easy interface. * * argv1 = URL diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 78d123baa..da29a4678 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ - + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 48ccaf38e..dc3bcae86 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ /* * The purpose of this test is to minimally exercise libcurl's internal diff --git a/tests/libtest/lib558.c b/tests/libtest/lib558.c deleted file mode 100644 index 56f2a2612..000000000 --- a/tests/libtest/lib558.c +++ /dev/null @@ -1,188 +0,0 @@ -/***************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - */ - -#include "test.h" - -#ifdef HAVE_SYS_SOCKET_H -# include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -# include <netinet/in.h> -#endif -#ifdef HAVE_NETDB_H -# include <netdb.h> -#endif -#ifdef HAVE_ARPA_INET_H -# include <arpa/inet.h> -#endif - -#define ENABLE_CURLX_PRINTF -#include "curlx.h" - -#include "hash.h" -#include "hostip.h" - -#include "curl_memory.h" -#include "memdebug.h" - -/* This source file is used for test # 558 and 559 */ - -/* - * This hacky test bypasses the library external API, - * using internal only libcurl functions. So don't be - * surprised if we cannot run it when the library has - * been built with hidden symbols, exporting only the - * ones in the public API. - */ - -#if defined(CURL_HIDDEN_SYMBOLS) -# define SKIP_TEST 1 -#elif defined(WIN32) && !defined(CURL_STATICLIB) -# define SKIP_TEST 1 -#else -# undef SKIP_TEST -#endif - - -#if !defined(SKIP_TEST) - -#ifdef LIB559 -static Curl_addrinfo *fake_ai(void) -{ - Curl_addrinfo *ai; - int ss_size; - - ss_size = sizeof (struct sockaddr_in); - - if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL) - return NULL; - - if((ai->ai_canonname = strdup("dummy")) == NULL) { - free(ai); - return NULL; - } - - if((ai->ai_addr = calloc(1, ss_size)) == NULL) { - free(ai->ai_canonname); - free(ai); - return NULL; - } - - ai->ai_family = AF_INET; - ai->ai_addrlen = ss_size; - - return ai; -} -#endif /* LIB559 */ - - -int test(char *URL) -{ - CURL *easyh = NULL; - struct curl_hash *hp = NULL; - int result = 0; - - if(!strcmp(URL, "check")) { - /* test harness script verifying if this test can run */ - return 0; /* sure, run this! */ - } - - easyh = curl_easy_init(); - if(!easyh) { - fprintf(stdout, "easy handle init failed\n"); - result = TEST_ERR_MAJOR_BAD; - goto cleanup; - } - fprintf(stdout, "easy handle init OK\n"); - - fprintf(stdout, "creating hash...\n"); - hp = Curl_mk_dnscache(); - if(!hp) { - fprintf(stdout, "hash creation failed\n"); - result = TEST_ERR_MAJOR_BAD; - goto cleanup; - } - fprintf(stdout, "hash creation OK\n"); - - /**/ -#ifdef LIB559 - { - char *data_key; - struct Curl_dns_entry *data_node; - struct Curl_dns_entry *nodep; - size_t key_len; - - data_key = aprintf("%s:%d", "dummy", 0); - if(!data_key) { - fprintf(stdout, "data key creation failed\n"); - result = TEST_ERR_MAJOR_BAD; - goto cleanup; - } - key_len = strlen(data_key); - - data_node = calloc(1, sizeof(struct Curl_dns_entry)); - if(!data_node) { - fprintf(stdout, "data node creation failed\n"); - result = TEST_ERR_MAJOR_BAD; - free(data_key); - goto cleanup; - } - - data_node->addr = fake_ai(); - if(!data_node->addr) { - fprintf(stdout, "actual data creation failed\n"); - result = TEST_ERR_MAJOR_BAD; - free(data_node); - free(data_key); - goto cleanup; - } - - nodep = Curl_hash_add(hp, data_key, key_len+1, (void *)data_node); - if(!nodep) { - fprintf(stdout, "insertion into hash failed\n"); - result = TEST_ERR_MAJOR_BAD; - Curl_freeaddrinfo(data_node->addr); - free(data_node); - free(data_key); - goto cleanup; - } - - free(data_key); - } -#endif /* LIB559 */ - /**/ - -cleanup: - - fprintf(stdout, "destroying hash...\n"); - Curl_hash_destroy(hp); - fprintf(stdout, "hash destruction OK\n"); - - fprintf(stdout, "destroying easy handle...\n"); - curl_easy_cleanup(easyh); - fprintf(stdout, "easy handle destruction OK\n"); - - curl_global_cleanup(); - - return result; -} - - -#else /* !defined(SKIP_TEST) */ - - -int test(char *URL) -{ - (void)URL; - fprintf(stdout, "libcurl built with hidden symbols"); - return 1; /* skip test */ -} - - -#endif /* !defined(SKIP_TEST) */ diff --git a/tests/libtest/lib560.c b/tests/libtest/lib560.c index 87e854555..081ad738f 100644 --- a/tests/libtest/lib560.c +++ b/tests/libtest/lib560.c @@ -1,12 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * + * Copyright (C) 1998 - 2011, 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 http://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" /* diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c index acdd79aab..657a2d3cd 100644 --- a/tests/libtest/lib562.c +++ b/tests/libtest/lib562.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib564.c b/tests/libtest/lib564.c index d33f23042..c4495f517 100644 --- a/tests/libtest/lib564.c +++ b/tests/libtest/lib564.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib566.c b/tests/libtest/lib566.c index 889f15b3a..4aa6d98e9 100644 --- a/tests/libtest/lib566.c +++ b/tests/libtest/lib566.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib567.c b/tests/libtest/lib567.c index e1df0c1e4..7466e7475 100644 --- a/tests/libtest/lib567.c +++ b/tests/libtest/lib567.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib568.c b/tests/libtest/lib568.c index 1f16664cb..df0cd88d1 100644 --- a/tests/libtest/lib568.c +++ b/tests/libtest/lib568.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib569.c b/tests/libtest/lib569.c index b5182d64c..366e4c344 100644 --- a/tests/libtest/lib569.c +++ b/tests/libtest/lib569.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib570.c b/tests/libtest/lib570.c index 9fe2eceaa..29d30dbef 100644 --- a/tests/libtest/lib570.c +++ b/tests/libtest/lib570.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib571.c b/tests/libtest/lib571.c index 2892211aa..1b2bf7b74 100644 --- a/tests/libtest/lib571.c +++ b/tests/libtest/lib571.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib572.c b/tests/libtest/lib572.c index 18e74d4db..b54877cd4 100644 --- a/tests/libtest/lib572.c +++ b/tests/libtest/lib572.c @@ -1,11 +1,24 @@ - -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| - */ + * + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c index 5edb1814a..466185844 100644 --- a/tests/libtest/lib573.c +++ b/tests/libtest/lib573.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib574.c b/tests/libtest/lib574.c index 69b2979a8..8c5781609 100644 --- a/tests/libtest/lib574.c +++ b/tests/libtest/lib574.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib575.c b/tests/libtest/lib575.c index 521720e95..bb075dc1f 100644 --- a/tests/libtest/lib575.c +++ b/tests/libtest/lib575.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib576.c b/tests/libtest/lib576.c index 821eb61ac..48841b59d 100644 --- a/tests/libtest/lib576.c +++ b/tests/libtest/lib576.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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 "testutil.h" diff --git a/tests/libtest/lib577.c b/tests/libtest/lib577.c deleted file mode 100644 index bd52c6251..000000000 --- a/tests/libtest/lib577.c +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - */ - -#include "test.h" - -/* - * This hacky test bypasses the library external API, - * using internal only libcurl functions. So don't be - * surprised if we cannot run it when the library has - * been built with hidden symbols, exporting only the - * ones in the public API. - */ - -#if defined(CURL_HIDDEN_SYMBOLS) -# define SKIP_TEST 1 -#elif defined(WIN32) && !defined(CURL_STATICLIB) -# define SKIP_TEST 1 -#else -# undef SKIP_TEST -#endif - - -#if !defined(SKIP_TEST) - -#include "memdebug.h" - -#include "curl_fnmatch.h" - -#define MATCH CURL_FNMATCH_MATCH -#define NOMATCH CURL_FNMATCH_NOMATCH -#define RE_ERR CURL_FNMATCH_FAIL - -#define MAX_PATTERN_L 100 -#define MAX_STRING_L 100 - -struct testcase { - char pattern[MAX_PATTERN_L]; - char string[MAX_STRING_L]; - int result; -}; - -static const struct testcase tests[] = { - /* brackets syntax */ - { "\\[", "[", MATCH }, - { "[", "[", RE_ERR }, - { "[]", "[]", RE_ERR }, - { "[][]", "[", MATCH }, - { "[][]", "]", MATCH }, - { "[[]", "[", MATCH }, - { "[[[]", "[", MATCH }, - { "[[[[]", "[", MATCH }, - { "[[[[]", "[", MATCH }, - - { "[][[]", "]", MATCH }, - { "[][[[]", "[", MATCH }, - { "[[]", "]", NOMATCH }, - - { "[a-z]", "a", MATCH }, - { "[a-z]", "A", NOMATCH }, - { "?[a-z]", "?Z", NOMATCH }, - { "[A-Z]", "C", MATCH }, - { "[A-Z]", "c", NOMATCH }, - { "[0-9]", "7", MATCH }, - { "[7-8]", "7", MATCH }, - { "[7-]", "7", MATCH }, - { "[7-]", "-", MATCH }, - { "[7-]", "[", NOMATCH }, - { "[a-bA-F]", "F", MATCH }, - { "[a-bA-B9]", "9", MATCH }, - { "[a-bA-B98]", "8", MATCH }, - { "[a-bA-B98]", "C", NOMATCH }, - { "[a-bA-Z9]", "F", MATCH }, - { "[a-bA-Z9]ero*", "Zero chance.", MATCH }, - { "S[a-][x]opho*", "Saxophone", MATCH }, - { "S[a-][x]opho*", "SaXophone", NOMATCH }, - { "S[a-][x]*.txt", "S-x.txt", MATCH }, - { "[\\a-\\b]", "a", MATCH }, - { "[\\a-\\b]", "b", MATCH }, - { "[?*[][?*[][?*[]", "?*[", MATCH }, - { "[][?*-]", "]", MATCH }, - { "[][?*-]", "[", MATCH }, - { "[][?*-]", "?", MATCH }, - { "[][?*-]", "*", MATCH }, - { "[][?*-]", "-", MATCH }, - { "[]?*-]", "-", MATCH }, - { "?/b/c", "a/b/c", MATCH }, - { "^_{}~", "^_{}~", MATCH }, - { "!#%+,-./01234567889", "!#%+,-./01234567889", MATCH }, - { "PQRSTUVWXYZ]abcdefg", "PQRSTUVWXYZ]abcdefg", MATCH }, - { ":;=@ABCDEFGHIJKLMNO", ":;=@ABCDEFGHIJKLMNO", MATCH }, - - /* negate */ - { "[!a]", "b", MATCH }, - { "[!a]", "a", NOMATCH }, - { "[^a]", "b", MATCH }, - { "[^a]", "a", NOMATCH }, - { "[^a-z0-9A-Z]", "a", NOMATCH }, - { "[^a-z0-9A-Z]", "-", MATCH }, - { "curl[!a-z]lib", "curl lib", MATCH }, - { "curl[! ]lib", "curl lib", NOMATCH }, - { "[! ][ ]", " ", NOMATCH }, - { "[! ][ ]", "a ", MATCH }, - { "*[^a].t?t", "a.txt", NOMATCH }, - { "*[^a].t?t", "ba.txt", NOMATCH }, - { "*[^a].t?t", "ab.txt", MATCH }, - { "[!?*[]", "?", NOMATCH }, - { "[!!]", "!", NOMATCH }, - { "[!!]", "x", MATCH }, - - { "[[:alpha:]]", "a", MATCH }, - { "[[:alpha:]]", "9", NOMATCH }, - { "[[:alnum:]]", "a", MATCH }, - { "[[:alnum:]]", "[", NOMATCH }, - { "[[:alnum:]]", "]", NOMATCH }, - { "[[:alnum:]]", "9", MATCH }, - { "[[:digit:]]", "9", MATCH }, - { "[[:xdigit:]]", "9", MATCH }, - { "[[:xdigit:]]", "F", MATCH }, - { "[[:xdigit:]]", "G", NOMATCH }, - { "[[:upper:]]", "U", MATCH }, - { "[[:upper:]]", "u", NOMATCH }, - { "[[:lower:]]", "l", MATCH }, - { "[[:lower:]]", "L", NOMATCH }, - { "[[:print:]]", "L", MATCH }, - { "[[:print:]]", {'\10'}, NOMATCH }, - { "[[:print:]]", {'\10'}, NOMATCH }, - { "[[:space:]]", " ", MATCH }, - { "[[:space:]]", "x", NOMATCH }, - { "[[:graph:]]", " ", NOMATCH }, - { "[[:graph:]]", "x", MATCH }, - { "[[:blank:]]", {'\t'}, MATCH }, - { "[[:blank:]]", {' '}, MATCH }, - { "[[:blank:]]", {'\r'}, NOMATCH }, - { "[^[:blank:]]", {'\t'}, NOMATCH }, - { "[^[:print:]]", {'\10'}, MATCH }, - { "[[:lower:]][[:lower:]]", "ll", MATCH }, - - { "Curl[[:blank:]];-)", "Curl ;-)", MATCH }, - { "*[[:blank:]]*", " ", MATCH }, - { "*[[:blank:]]*", "", NOMATCH }, - { "*[[:blank:]]*", "hi, im_Pavel", MATCH }, - - /* common using */ - { "filename.dat", "filename.dat", MATCH }, - { "*curl*", "lets use curl!!", MATCH }, - { "filename.txt", "filename.dat", NOMATCH }, - { "*.txt", "text.txt", MATCH }, - { "*.txt", "a.txt", MATCH }, - { "*.txt", ".txt", MATCH }, - { "*.txt", "txt", NOMATCH }, - { "??.txt", "99.txt", MATCH }, - { "??.txt", "a99.txt", NOMATCH }, - { "?.???", "a.txt", MATCH }, - { "*.???", "somefile.dat", MATCH }, - { "*.???", "photo.jpeg", NOMATCH }, - { ".*", ".htaccess", MATCH }, - { ".*", ".", MATCH }, - { ".*", "..", MATCH }, - - /* many stars => one star */ - { "**.txt", "text.txt", MATCH }, - { "***.txt", "t.txt", MATCH }, - { "****.txt", ".txt", MATCH }, - - /* empty string or pattern */ - { "", "", MATCH } , - { "", "hello", NOMATCH }, - { "file", "", NOMATCH }, - { "?", "", NOMATCH }, - { "*", "", MATCH }, - { "x", "", NOMATCH }, - - /* backslash */ - { "\\", "\\", RE_ERR }, - { "\\\\", "\\", MATCH }, - { "\\\\", "\\\\", NOMATCH }, - { "\\?", "?", MATCH }, - { "\\*", "*", MATCH }, - { "?.txt", "?.txt", MATCH }, - { "*.txt", "*.txt", MATCH }, - { "\\?.txt", "?.txt", MATCH }, - { "\\*.txt", "*.txt", MATCH }, - { "\\?.txt", "x.txt", NOMATCH }, - { "\\*.txt", "x.txt", NOMATCH }, - { "\\*\\\\.txt", "*\\.txt", MATCH }, - { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH }, - { "*\\**\\?*\\\\*", "cc*cc?cccc", NOMATCH }, - { "*\\**\\?*\\\\*", "cc*cc?cc\\cc*cc", MATCH }, - { "*\\?*\\**", "cc?c*c", MATCH }, - { "*\\?*\\**curl*", "cc?c*curl", MATCH }, - { "*\\?*\\**", "cc?cc", NOMATCH }, - { "\\\"\\$\\&\\'\\(\\)", "\"$&'()", MATCH }, - { "\\*\\?\\[\\\\\\`\\|", "*?[\\`|", MATCH }, - { "[\\a\\b]c", "ac", MATCH }, - { "[\\a\\b]c", "bc", MATCH }, - { "[\\a\\b]d", "bc", NOMATCH }, - { "[a-bA-B\\?]", "?", MATCH }, - { "cu[a-ab-b\\r]l", "curl", MATCH }, - { "[\\a-z]", "c", MATCH }, - - { "?*?*?.*?*", "abc.c", MATCH }, - { "?*?*?.*?*", "abcc", NOMATCH }, - { "?*?*?.*?*", "abc.", NOMATCH }, - { "?*?*?.*?*", "abc.c++", MATCH }, - { "?*?*?.*?*", "abcdef.c++", MATCH }, - { "?*?*?.?", "abcdef.c", MATCH }, - { "?*?*?.?", "abcdef.cd", NOMATCH }, - - { "Lindmätarv", "Lindmätarv", MATCH }, - - { "", "", MATCH } -}; - - -int test(char *URL) -{ - int testnum = sizeof(tests) / sizeof(struct testcase); - int i, rc; - (void)URL; /* not used */ - - if(!strcmp(URL, "check")) { - /* test harness script verifying if this test can run */ - return 0; /* sure, run this! */ - } - - printf("===========================\n"); - for(i = 0; i < testnum; i++) { - rc = Curl_fnmatch(NULL, tests[i].pattern, tests[i].string); - if(rc != tests[i].result) { - printf("Curl_fnmatch(\"%s\", \"%s\") should return %d (returns %d)\n", - tests[i].pattern, tests[i].string, tests[i].result, rc); - } - } - printf("===========================\n"); - return 0; -} - -#else /* !defined(SKIP_TEST) */ - - -int test(char *URL) -{ - (void)URL; - fprintf(stdout, "libcurl built with hidden symbols"); - return 1; /* skip test */ -} - - -#endif /* !defined(SKIP_TEST) */ diff --git a/tests/libtest/lib578.c b/tests/libtest/lib578.c index 2efb003ae..51ead8722 100644 --- a/tests/libtest/lib578.c +++ b/tests/libtest/lib578.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index 2b80ab0b6..ad8ba7e97 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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" diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c new file mode 100644 index 000000000..7f87f1d15 --- /dev/null +++ b/tests/libtest/lib582.c @@ -0,0 +1,377 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2011, 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 http://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 <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "testutil.h" +#include "memdebug.h" + +#define MAIN_LOOP_HANG_TIMEOUT 4 * 1000 + +struct Sockets +{ + curl_socket_t* sockets; + int count; +}; + +struct ReadWriteSockets +{ + struct Sockets read, write; +}; + +/** + * Remove a file descriptor from a sockets array. + */ +static void removeFd(struct Sockets* sockets, curl_socket_t fd, int mention) +{ + int i; + + if(mention) + fprintf(stderr, "Remove socket fd %d\n", (int) fd); + + for (i = 0; i < sockets->count; ++i) { + if (sockets->sockets[i] == fd) { + memmove(&sockets->sockets[i], &sockets->sockets[i + 1], + sizeof(curl_socket_t) * (sockets->count - i - 1)); + --sockets->count; + } + } +} + +/** + * Add a file descriptor to a sockets array. + */ +static void addFd(struct Sockets* sockets, curl_socket_t fd, const char *what) +{ + /** + * To ensure we only have each file descriptor once, we remove it then add + * it again. + */ + fprintf(stderr, "Add socket fd %d for %s\n", (int) fd, what); + removeFd(sockets, fd, 0); + sockets->sockets = realloc(sockets->sockets, + sizeof(curl_socket_t) * (sockets->count + 1)); + sockets->sockets[sockets->count] = fd; + ++sockets->count; +} + +/** + * Callback invoked by curl to poll reading / writing of a socket. + */ +static int curlSocketCallback(CURL *easy, curl_socket_t s, int action, + void *userp, void *socketp) +{ + struct ReadWriteSockets* sockets = userp; + + (void)easy; /* unused */ + (void)socketp; /* unused */ + + if (action == CURL_POLL_IN || action == CURL_POLL_INOUT) + addFd(&sockets->read, s, "read"); + + if (action == CURL_POLL_OUT || action == CURL_POLL_INOUT) + addFd(&sockets->write, s, "write"); + + if(action == CURL_POLL_REMOVE) { + removeFd(&sockets->read, s, 1); + removeFd(&sockets->write, s, 0); + } + + return 0; +} + +/** + * Callback invoked by curl to set a timeout. + */ +static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) +{ + struct timeval* timeout = userp; + + (void)multi; /* unused */ + if (timeout_ms != -1) { + gettimeofday(timeout, 0); + timeout->tv_usec += timeout_ms * 1000; + } + else { + timeout->tv_sec = -1; + } + return 0; +} + +/** + * Check for curl completion. + */ +static int checkForCompletion(CURLM* curl, int* success) +{ + int numMessages; + CURLMsg* message; + int result = 0; + *success = 0; + while ((message = curl_multi_info_read(curl, &numMessages)) != 0) { + if (message->msg == CURLMSG_DONE) { + result = 1; + if (message->data.result == CURLE_OK) + *success = 1; + else + *success = 0; + } + else { + fprintf(stderr, "Got an unexpected message from curl: %i\n", + message->msg); + result = 1; + *success = 0; + } + } + return result; +} + +static int getMicroSecondTimeout(struct timeval* timeout) +{ + struct timeval now; + int result; + + gettimeofday(&now, 0); + result = (timeout->tv_sec - now.tv_sec) * 1000000 + + timeout->tv_usec - now.tv_usec; + if (result < 0) + result = 0; + + return result; +} + +/** + * Update a fd_set with all of the sockets in use. + */ +static void updateFdSet(struct Sockets* sockets, fd_set* fdset, int* maxFd) +{ + int i; + for (i = 0; i < sockets->count; ++i) { + FD_SET(sockets->sockets[i], fdset); + if (*maxFd < sockets->sockets[i] + 1) { + *maxFd = sockets->sockets[i] + 1; + } + } +} + +static void notifyCurl(CURL* curl, curl_socket_t s, int evBitmask, + const char* info) +{ + int numhandles = 0; + CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); + if (result != CURLM_OK && result != CURLM_CALL_MULTI_PERFORM) + { + fprintf(stderr, "Curl error on %s: %i (%s)\n", + info, result, curl_multi_strerror(result)); + } +} + +/** + * Invoke curl when a file descriptor is set. + */ +static void checkFdSet(CURL* curl, struct Sockets* sockets, fd_set* fdset, + int evBitmask, const char* name) +{ + int i; + for (i = 0; i < sockets->count; ++i) + { + if (FD_ISSET(sockets->sockets[i], fdset)) + { + notifyCurl(curl, sockets->sockets[i], evBitmask, name); + } + } +} + +int test(char *URL) +{ + int res = 0; + CURL *curl; + FILE *hd_src ; + int hd ; + int error; + struct_stat file_info; + CURLM *m = NULL; + struct timeval ml_start; + char ml_timedout = FALSE; + struct ReadWriteSockets sockets = {{0, 0}, {0, 0}}; + struct timeval timeout = {-1, 0}; + int success = 0; + + if (!libtest_arg3) { + fprintf(stderr, "Usage: lib582 [url] [filename] [username]\n"); + return -1; + } + + hd_src = fopen(libtest_arg2, "rb"); + if(NULL == hd_src) { + error = ERRNO; + fprintf(stderr, "fopen() failed with error: %d %s\n", + error, strerror(error)); + fprintf(stderr, "Error opening file: %s\n", libtest_arg2); + return TEST_ERR_MAJOR_BAD; + } + + /* get the file size of the local file */ + hd = fstat(fileno(hd_src), &file_info); + if(hd == -1) { + /* can't open file, bail out */ + error = ERRNO; + fprintf(stderr, "fstat() failed with error: %d %s\n", + error, strerror(error)); + fprintf(stderr, "ERROR: cannot open file %s\n", libtest_arg2); + fclose(hd_src); + return -1; + } + fprintf(stderr, "Set to upload %d bytes\n", (int)file_info.st_size); + + if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + fprintf(stderr, "curl_global_init() failed\n"); + fclose(hd_src); + return TEST_ERR_MAJOR_BAD; + } + + if ((curl = curl_easy_init()) == NULL) { + fprintf(stderr, "curl_easy_init() failed\n"); + fclose(hd_src); + curl_global_cleanup(); + return TEST_ERR_MAJOR_BAD; + } + + /* enable uploading */ + test_setopt(curl, CURLOPT_UPLOAD, 1L); + + /* specify target */ + test_setopt(curl,CURLOPT_URL, URL); + + /* go verbose */ + test_setopt(curl, CURLOPT_VERBOSE, 1L); + + /* now specify which file to upload */ + test_setopt(curl, CURLOPT_READDATA, hd_src); + + test_setopt(curl, CURLOPT_USERPWD, libtest_arg3); + test_setopt(curl, CURLOPT_SSH_PUBLIC_KEYFILE, "curl_client_key.pub"); + test_setopt(curl, CURLOPT_SSH_PRIVATE_KEYFILE, "curl_client_key"); + + test_setopt(curl, CURLOPT_INFILESIZE_LARGE, + (curl_off_t)file_info.st_size); + + if ((m = curl_multi_init()) == NULL) { + fprintf(stderr, "curl_multi_init() failed\n"); + curl_easy_cleanup(curl); + curl_global_cleanup(); + fclose(hd_src); + return TEST_ERR_MAJOR_BAD; + } + test_multi_setopt(m, CURLMOPT_SOCKETFUNCTION, curlSocketCallback); + test_multi_setopt(m, CURLMOPT_SOCKETDATA, &sockets); + + test_multi_setopt(m, CURLMOPT_TIMERFUNCTION, curlTimerCallback); + test_multi_setopt(m, CURLMOPT_TIMERDATA, &timeout); + + if ((res = (int)curl_multi_add_handle(m, curl)) != CURLM_OK) { + fprintf(stderr, "curl_multi_add_handle() failed, " + "with code %d\n", res); + curl_multi_cleanup(m); + curl_easy_cleanup(curl); + curl_global_cleanup(); + fclose(hd_src); + return TEST_ERR_MAJOR_BAD; + } + + ml_timedout = FALSE; + ml_start = tutil_tvnow(); + + while (!checkForCompletion(m, &success)) + { + fd_set readSet, writeSet; + int maxFd = 0; + struct timeval tv = {10, 0}; + + if (tutil_tvdiff(tutil_tvnow(), ml_start) > + MAIN_LOOP_HANG_TIMEOUT) { + ml_timedout = TRUE; + break; + } + + FD_ZERO(&readSet); + FD_ZERO(&writeSet); + updateFdSet(&sockets.read, &readSet, &maxFd); + updateFdSet(&sockets.write, &writeSet, &maxFd); + + if (timeout.tv_sec != -1) + { + int usTimeout = getMicroSecondTimeout(&timeout); + tv.tv_sec = usTimeout / 1000000; + tv.tv_usec = usTimeout % 1000000; + } + else if (maxFd <= 0) + { + tv.tv_sec = 0; + tv.tv_usec = 100000; + } + + select_test(maxFd, &readSet, &writeSet, NULL, &tv); + + /* Check the sockets for reading / writing */ + checkFdSet(m, &sockets.read, &readSet, CURL_CSELECT_IN, "read"); + checkFdSet(m, &sockets.write, &writeSet, CURL_CSELECT_OUT, "write"); + + if (timeout.tv_sec != -1 && getMicroSecondTimeout(&timeout) == 0) + { + /* Curl's timer has elapsed. */ + notifyCurl(m, CURL_SOCKET_TIMEOUT, 0, "timeout"); + } + } + + if (!success) + { + fprintf(stderr, "Error uploading file.\n"); + res = TEST_ERR_MAJOR_BAD; + } + else if (ml_timedout) { + fprintf(stderr, "ABORTING TEST, since it seems " + "that it would have run forever.\n"); + res = TEST_ERR_RUNS_FOREVER; + } + +test_cleanup: + + if(m) + curl_multi_remove_handle(m, curl); + curl_easy_cleanup(curl); + if(m) { + fprintf(stderr, "Now multi-cleanup!\n"); + curl_multi_cleanup(m); + } + + fclose(hd_src); /* close the local file */ + if (sockets.read.sockets != 0) + free(sockets.read.sockets); + if (sockets.write.sockets != 0) + free(sockets.write.sockets); + + curl_global_cleanup(); + return res; +} diff --git a/tests/libtest/lib583.c b/tests/libtest/lib583.c new file mode 100644 index 000000000..d01d98f1f --- /dev/null +++ b/tests/libtest/lib583.c @@ -0,0 +1,73 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ +/* + * This test case is based on the sample code provided by Saqib Ali + * http://curl.haxx.se/mail/lib-2011-03/0066.html + */ + +#include "test.h" + +#include <unistd.h> +#include <sys/stat.h> + +int test(char *URL) +{ + CURLMcode retVal; + int stillRunning, retValcm; + CURLM* multiHandle; + CURL* curl; + int res; + + curl_global_init(CURL_GLOBAL_ALL); + + multiHandle = curl_multi_init(); + curl = curl_easy_init(); + + test_setopt(curl, CURLOPT_USERPWD, libtest_arg2); + test_setopt(curl, CURLOPT_SSH_PUBLIC_KEYFILE, "curl_client_key.pub"); + test_setopt(curl, CURLOPT_SSH_PRIVATE_KEYFILE, "curl_client_key"); + + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); + + curl_easy_setopt(curl, CURLOPT_URL, URL); + curl_easy_setopt(curl, CURLOPT_INFILESIZE, (long)5); + + curl_multi_add_handle(multiHandle, curl); + retVal = curl_multi_perform(multiHandle, &stillRunning); + if (retVal != CURLM_OK) + fprintf(stderr, "curl_multi_perform() failed!n"); + + fprintf(stderr, "curl_multi_remove_handle()!\n"); + retVal = curl_multi_remove_handle(multiHandle, curl); + if (retVal == CURLM_OK) + fprintf(stderr, "curl_multi_remove_handle() was successful!\n"); + else + fprintf(stderr, "curl_multi_remove_handle() failed\n"); + +test_cleanup: + + curl_easy_cleanup(curl); + curl_multi_cleanup(multiHandle); + + return res; +} diff --git a/tests/libtest/sethostname.c b/tests/libtest/sethostname.c index 3dabb8231..daf94f95c 100644 --- a/tests/libtest/sethostname.c +++ b/tests/libtest/sethostname.c @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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 "setup.h" diff --git a/tests/libtest/sethostname.h b/tests/libtest/sethostname.h index 83034a536..e2633dd7f 100644 --- a/tests/libtest/sethostname.h +++ b/tests/libtest/sethostname.h @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ #if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(CURL_STATICLIB) # if defined(BUILDING_LIBCURL) diff --git a/tests/libtest/test.h b/tests/libtest/test.h index 2a3671181..e9638a240 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -1,11 +1,24 @@ -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - */ + * Copyright (C) 1998 - 2011, 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 http://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. + * + ***************************************************************************/ /* Now include the setup.h file from libcurl's private libdir (the source version, but that might include "curl_config.h" from the build dir so we @@ -44,6 +57,9 @@ #define test_setopt(A,B,C) \ if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup +#define test_multi_setopt(A,B,C) \ + if((res = curl_multi_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup + extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */ extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */ |