~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to tests/libtest/lib554.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-04-02 23:35:45 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090402233545-8xjr3o2sgce5s4bg
Tags: 7.19.4-1
* New upstream release
* Fix "newer bdb version" <explain what you changed and why> 
  (Closes: #517277)
* resolve libtool version confusion, thanks to 
  Stefanos Harhalakis <v13@v13.gr>
* add new dependency on libgcrypt11-dev due to newly arising binary symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: lib554.c,v 1.3 2008-05-22 21:49:53 danf Exp $
 
8
 * $Id: lib554.c,v 1.5 2008-09-20 04:26:57 yangtse Exp $
9
9
 */
10
10
 
11
11
#include "test.h"
12
12
 
 
13
#include "memdebug.h"
 
14
 
13
15
static char data[]="this is what we post to the silly web server\n";
14
16
 
15
17
struct WriteThis {
44
46
  struct curl_httppost *lastptr=NULL;
45
47
  struct WriteThis pooh;
46
48
 
 
49
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
 
50
    fprintf(stderr, "curl_global_init() failed\n");
 
51
    return TEST_ERR_MAJOR_BAD;
 
52
  }
 
53
 
47
54
  pooh.readptr = data;
48
55
  pooh.sizeleft = strlen(data);
49
56
 
50
 
  curl_global_init(CURL_GLOBAL_ALL);
51
 
 
52
57
  /* Fill in the file upload field */
53
58
  formrc = curl_formadd(&formpost,
54
59
                        &lastptr,
81
86
  if(formrc)
82
87
    printf("curl_formadd(3) = %d\n", (int)formrc);
83
88
 
84
 
  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
85
 
    fprintf(stderr, "curl_global_init() failed\n");
86
 
    return TEST_ERR_MAJOR_BAD;
87
 
  }
88
 
 
89
89
  if ((curl = curl_easy_init()) == NULL) {
90
90
    fprintf(stderr, "curl_easy_init() failed\n");
 
91
    curl_formfree(formpost);
91
92
    curl_global_cleanup();
92
93
    return TEST_ERR_MAJOR_BAD;
93
94
  }