aboutsummaryrefslogtreecommitdiff
path: root/tests/torture.h
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2020-12-15 13:35:06 +0100
committerAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2021-01-12 12:54:18 +0100
commit8e56585c72f5c8bed6e0747b35dfec4bb0208694 (patch)
tree526dcacb6889512c91f0a4ea11e9b16cabf7f441 /tests/torture.h
parentd4258d1461d0acdca758f8df30d2f40ea6b7bf16 (diff)
downloadlibssh-8e56585c72f5c8bed6e0747b35dfec4bb0208694.tar.gz
libssh-8e56585c72f5c8bed6e0747b35dfec4bb0208694.tar.xz
libssh-8e56585c72f5c8bed6e0747b35dfec4bb0208694.zip
tests/external_override: Add override test for internal implementations
This adds a test to check if the internal implementation is not used when it is not supposed to be used. To be able to override functions using LD_PRELOAD, a shared version of the torture library was added, as well as a shared library for each of the algorithms implemented internally (ChaCha20, Poly1305, curve25519, and ed25519). Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'tests/torture.h')
-rw-r--r--tests/torture.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/torture.h b/tests/torture.h
index dc211443..b9b87b6a 100644
--- a/tests/torture.h
+++ b/tests/torture.h
@@ -144,7 +144,11 @@ void torture_setup_libssh_server(void **state, const char *server_path);
/*
* This function must be defined in every unit test file.
*/
+#if ((defined _WIN32) || (defined _WIN64)) && (defined USE_ATTRIBUTE_WEAK)
+__attribute__((weak)) int torture_run_tests(void);
+#else
int torture_run_tests(void);
+#endif
char *torture_make_temp_dir(const char *template);
char *torture_create_temp_file(const char *template);