1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

unittest: mark all unit tested functions

With "@unittest: [num]" in the header comment for each tested function.
Shows we have a log way to go still...
This commit is contained in:
Daniel Stenberg 2011-06-10 14:40:46 +02:00
parent d5cc77b744
commit 0f7bea7c3a
8 changed files with 34 additions and 6 deletions

View File

@ -73,6 +73,8 @@ static void decodeQuantum(unsigned char *dest, const char *src)
* *
* Given a base64 string at src, decode it and return an allocated memory in * Given a base64 string at src, decode it and return an allocated memory in
* the *outptr. Returns the length of the decoded data. * the *outptr. Returns the length of the decoded data.
*
* @unittest: 1302
*/ */
size_t Curl_base64_decode(const char *src, unsigned char **outptr) size_t Curl_base64_decode(const char *src, unsigned char **outptr)
{ {
@ -135,6 +137,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr)
* is a pointer to an allocated area holding the base64 data. If something * is a pointer to an allocated area holding the base64 data. If something
* went wrong, 0 is returned. * went wrong, 0 is returned.
* *
* @unittest: 1302
*/ */
size_t Curl_base64_encode(struct SessionHandle *data, size_t Curl_base64_encode(struct SessionHandle *data,
const char *inputbuff, size_t insize, const char *inputbuff, size_t insize,

View File

@ -131,6 +131,8 @@ singleipconnect(struct connectdata *conn,
* If 'nowp' is non-NULL, it points to the current time. * If 'nowp' is non-NULL, it points to the current time.
* 'duringconnect' is FALSE if not during a connect, as then of course the * 'duringconnect' is FALSE if not during a connect, as then of course the
* connect timeout is not taken into account! * connect timeout is not taken into account!
*
* @unittest: 1303
*/ */
long Curl_timeleft(struct SessionHandle *data, long Curl_timeleft(struct SessionHandle *data,
struct timeval *nowp, struct timeval *nowp,

View File

@ -413,6 +413,9 @@ static int loop(const unsigned char *pattern, const unsigned char *string)
} }
} }
/*
* @unittest: 1307
*/
int Curl_fnmatch(void *ptr, const char *pattern, const char *string) int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
{ {
(void)ptr; /* the argument is specified by the curl_fnmatch_callback (void)ptr; /* the argument is specified by the curl_fnmatch_callback

View File

@ -737,6 +737,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
/* /*
* curl_formadd() is a public API to add a section to the multipart formpost. * curl_formadd() is a public API to add a section to the multipart formpost.
*
* @unittest: 1308
*/ */
CURLFORMcode curl_formadd(struct curl_httppost **httppost, CURLFORMcode curl_formadd(struct curl_httppost **httppost,
@ -858,6 +860,8 @@ void Curl_formclean(struct FormData **form_ptr)
* curl_formget() * curl_formget()
* Serialize a curl_httppost struct. * Serialize a curl_httppost struct.
* Returns 0 on success. * Returns 0 on success.
*
* @unittest: 1308
*/ */
int curl_formget(struct curl_httppost *form, void *arg, int curl_formget(struct curl_httppost *form, void *arg,
curl_formget_callback append) curl_formget_callback append)

View File

@ -140,7 +140,10 @@ mk_hash_element(const void *key, size_t key_len, const void *p)
#define FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)] #define FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)]
/* Insert the data in the hash. If there already was a match in the hash, /* Insert the data in the hash. If there already was a match in the hash,
that data is replaced. */ * that data is replaced.
*
* @unittest: 1305
*/
void * void *
Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p)
{ {

View File

@ -62,6 +62,8 @@ Curl_llist_alloc(curl_llist_dtor dtor)
* inserted first in the list. * inserted first in the list.
* *
* Returns: 1 on success and 0 on failure. * Returns: 1 on success and 0 on failure.
*
* @unittest: 1300
*/ */
int int
Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e, Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e,
@ -101,8 +103,10 @@ Curl_llist_insert_next(struct curl_llist *list, struct curl_llist_element *e,
return 1; return 1;
} }
int /*
Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e, * @unittest: 1300
*/
int Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e,
void *user) void *user)
{ {
if(e == NULL || list->size == 0) if(e == NULL || list->size == 0)

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -61,6 +61,9 @@ enum host_lookup_state {
HOSTEND /* LAST enum */ HOSTEND /* LAST enum */
}; };
/*
* @unittest: 1304
*/
int Curl_parsenetrc(const char *host, int Curl_parsenetrc(const char *host,
char *login, char *login,
char *password, char *password,

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -31,6 +31,9 @@
#include "strequal.h" #include "strequal.h"
/*
* @unittest: 1301
*/
int curl_strequal(const char *first, const char *second) int curl_strequal(const char *first, const char *second)
{ {
#if defined(HAVE_STRCASECMP) #if defined(HAVE_STRCASECMP)
@ -51,6 +54,9 @@ int curl_strequal(const char *first, const char *second)
#endif #endif
} }
/*
* @unittest: 1301
*/
int curl_strnequal(const char *first, const char *second, size_t max) int curl_strnequal(const char *first, const char *second, size_t max)
{ {
#if defined(HAVE_STRNCASECMP) #if defined(HAVE_STRNCASECMP)