diff options
author | William Wennerström <william@wstrm.dev> | 2020-07-21 11:36:09 +0200 |
---|---|---|
committer | William Wennerström <william@wstrm.dev> | 2020-11-16 21:58:10 +0100 |
commit | be62b446f778ba6c064d6e054dfb7b5eacb1f1ae (patch) | |
tree | bdec767b86df6d40b62aa68566d693a8da8ec385 /tests/unittests | |
parent | ab83afe21b1a7d5d2aff5f029687ea659e05360f (diff) | |
download | profani-tty-be62b446f778ba6c064d6e054dfb7b5eacb1f1ae.tar.gz |
Add stubs
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/tools/stub_aesgcm_download.c | 23 | ||||
-rw-r--r-- | tests/unittests/tools/stub_http_common.c | 16 | ||||
-rw-r--r-- | tests/unittests/tools/stub_http_download.c | 2 |
3 files changed, 39 insertions, 2 deletions
diff --git a/tests/unittests/tools/stub_aesgcm_download.c b/tests/unittests/tools/stub_aesgcm_download.c new file mode 100644 index 00000000..58696e80 --- /dev/null +++ b/tests/unittests/tools/stub_aesgcm_download.c @@ -0,0 +1,23 @@ +#ifndef TOOLS_AESGCM_DOWNLOAD_H +#define TOOLS_AESGCM_DOWNLOAD_H + +#include <pthread.h> + +typedef struct prof_win_t ProfWin; +typedef struct http_download_t HTTPDownload; + +typedef struct aesgcm_download_t +{ + char* url; + char* filename; + ProfWin* window; + pthread_t worker; + HTTPDownload* http_dl; +} AESGCMDownload; + +void* aesgcm_file_get(void* userdata); + +void aesgcm_download_cancel_processes(ProfWin* window); +void aesgcm_download_add_download(AESGCMDownload* download); + +#endif diff --git a/tests/unittests/tools/stub_http_common.c b/tests/unittests/tools/stub_http_common.c new file mode 100644 index 00000000..23e0a23f --- /dev/null +++ b/tests/unittests/tools/stub_http_common.c @@ -0,0 +1,16 @@ +#ifndef TOOLS_HTTP_COMMON_H +#define TOOLS_HTTP_COMMON_H + +typedef struct prof_win_t ProfWin; + +char* +http_basename_from_url(const char* url) +{ + return ""; +} + +void http_print_transfer(ProfWin* window, char* url, const char* fmt, ...); +void http_print_transfer_update(ProfWin* window, char* url, + const char* fmt, ...); + +#endif diff --git a/tests/unittests/tools/stub_http_download.c b/tests/unittests/tools/stub_http_download.c index 202c9cbf..fb2cb1b8 100644 --- a/tests/unittests/tools/stub_http_download.c +++ b/tests/unittests/tools/stub_http_download.c @@ -23,6 +23,4 @@ void* http_file_get(void* userdata); void http_download_cancel_processes(ProfWin* window); void http_download_add_download(HTTPDownload* download); -char* http_filename_from_url(const char* url); - #endif |