unit1605.c
Go to the documentation of this file.
1 /***************************************************************************
2  * _ _ ____ _
3  * Project ___| | | | _ \| |
4  * / __| | | | |_) | |
5  * | (__| |_| | _ <| |___
6  * \___|\___/|_| \_\_____|
7  *
8  * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
9  *
10  * This software is licensed as described in the file COPYING, which
11  * you should have received as part of this distribution. The terms
12  * are also available at https://curl.haxx.se/docs/copyright.html.
13  *
14  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15  * copies of the Software, and permit persons to whom the Software is
16  * furnished to do so, under the terms of the COPYING file.
17  *
18  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19  * KIND, either express or implied.
20  *
21  ***************************************************************************/
22 #include "curlcheck.h"
23 
24 #include "llist.h"
25 
26 static CURL *easy;
27 
28 static CURLcode unit_setup(void)
29 {
30  int res = CURLE_OK;
31 
33  easy = curl_easy_init();
34  if(!easy)
35  return CURLE_OUT_OF_MEMORY;
36  return res;
37 }
38 
39 static void unit_stop(void)
40 {
43 }
44 
46  int len;
47  char *esc;
48 
49  esc = curl_easy_escape(easy, "", -1);
50  fail_unless(esc == NULL, "negative string length can't work");
51 
52  esc = curl_easy_unescape(easy, "%41%41%41%41", -1, &len);
53  fail_unless(esc == NULL, "negative string length can't work");
54 
#define UNITTEST_START
Definition: curlcheck.h:86
CURL_EXTERN char * curl_easy_escape(CURL *handle, const char *string, int length)
#define global_init(A)
Definition: test.h:431
static CURLcode unit_setup(void)
Definition: unit1605.c:28
CURLcode
Definition: curl.h:454
static int res
CURL_EXTERN CURL * curl_easy_init(void)
Definition: easy.c:343
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
Definition: curl.h:455
#define UNITTEST_STOP
Definition: curlcheck.h:95
fail_unless(esc==NULL,"negative string length can't work")
UNITTEST_START int len
Definition: unit1605.c:46
static CURL * easy
Definition: unit1605.c:26
void CURL
Definition: curl.h:102
char * esc
Definition: unit1605.c:47
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
Definition: easy.c:312
#define CURL_GLOBAL_ALL
Definition: curl.h:2519
static void unit_stop(void)
Definition: unit1605.c:39
CURL_EXTERN char * curl_easy_unescape(CURL *handle, const char *string, int length, int *outlength)


rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:16