about summary refs log tree commit diff stats
path: root/tests/unittests
diff options
context:
space:
mode:
authorWilliam Wennerström <william@wstrm.dev>2020-07-21 13:11:50 +0200
committerWilliam Wennerström <william@wstrm.dev>2020-11-16 21:58:10 +0100
commit1bb6cecee69d5167220a18cc4c125c215784de66 (patch)
treeb5632677f0cf1da803cb73fc3575ac34df834a5b /tests/unittests
parentbe62b446f778ba6c064d6e054dfb7b5eacb1f1ae (diff)
downloadprofani-tty-1bb6cecee69d5167220a18cc4c125c215784de66.tar.gz
Fix stubs and move some tests to http_common
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_http_common.c (renamed from tests/unittests/test_http_download.c)2
-rw-r--r--tests/unittests/test_http_common.h (renamed from tests/unittests/test_http_download.h)0
-rw-r--r--tests/unittests/tools/stub_aesgcm_download.c10
-rw-r--r--tests/unittests/tools/stub_http_common.c16
-rw-r--r--tests/unittests/tools/stub_http_download.c5
-rw-r--r--tests/unittests/tools/stub_http_upload.c3
-rw-r--r--tests/unittests/unittests.c2
7 files changed, 10 insertions, 28 deletions
diff --git a/tests/unittests/test_http_download.c b/tests/unittests/test_http_common.c
index 96d45d03..195f370b 100644
--- a/tests/unittests/test_http_download.c
+++ b/tests/unittests/test_http_common.c
@@ -8,7 +8,7 @@
 
 #include "config.h"
 
-#include "tools/http_download.h"
+#include "tools/http_common.c"
 
 typedef struct
 {
diff --git a/tests/unittests/test_http_download.h b/tests/unittests/test_http_common.h
index a1c62a7f..a1c62a7f 100644
--- a/tests/unittests/test_http_download.h
+++ b/tests/unittests/test_http_common.h
diff --git a/tests/unittests/tools/stub_aesgcm_download.c b/tests/unittests/tools/stub_aesgcm_download.c
index 58696e80..6f4cc0ce 100644
--- a/tests/unittests/tools/stub_aesgcm_download.c
+++ b/tests/unittests/tools/stub_aesgcm_download.c
@@ -15,9 +15,13 @@ typedef struct aesgcm_download_t
     HTTPDownload* http_dl;
 } AESGCMDownload;
 
-void* aesgcm_file_get(void* userdata);
+void*
+aesgcm_file_get(void* userdata)
+{
+    return NULL;
+};
 
-void aesgcm_download_cancel_processes(ProfWin* window);
-void aesgcm_download_add_download(AESGCMDownload* download);
+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
deleted file mode 100644
index 23e0a23f..00000000
--- a/tests/unittests/tools/stub_http_common.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#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 fb2cb1b8..5fa1c46e 100644
--- a/tests/unittests/tools/stub_http_download.c
+++ b/tests/unittests/tools/stub_http_download.c
@@ -18,9 +18,4 @@ typedef struct http_download_t
     int cancel;
 } HTTPDownload;
 
-void* http_file_get(void* userdata);
-
-void http_download_cancel_processes(ProfWin* window);
-void http_download_add_download(HTTPDownload* download);
-
 #endif
diff --git a/tests/unittests/tools/stub_http_upload.c b/tests/unittests/tools/stub_http_upload.c
index 25a81708..1b79e02d 100644
--- a/tests/unittests/tools/stub_http_upload.c
+++ b/tests/unittests/tools/stub_http_upload.c
@@ -20,8 +20,6 @@ typedef struct http_upload_t
     int cancel;
 } HTTPUpload;
 
-//GSList *upload_processes;
-
 void*
 http_file_put(void* userdata)
 {
@@ -33,6 +31,7 @@ file_mime_type(const char* const file_name)
 {
     return NULL;
 }
+
 off_t
 file_size(const char* const file_name)
 {
diff --git a/tests/unittests/unittests.c b/tests/unittests/unittests.c
index 06c1b307..cab99bf5 100644
--- a/tests/unittests/unittests.c
+++ b/tests/unittests/unittests.c
@@ -38,7 +38,7 @@
 #include "test_form.h"
 #include "test_callbacks.h"
 #include "test_plugins_disco.h"
-#include "test_http_download.h"
+#include "test_http_common.h"
 
 int
 main(int argc, char* argv[])