From 717eff71dda38a947dc4fd77f51cafd796ce9693 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Mon, 30 Aug 2010 14:08:07 +0200 Subject: Added test for the openssl threading --- tests/unittests/CMakeLists.txt | 1 + tests/unittests/torture_rand.c | 49 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/unittests/torture_rand.c diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 28aa50b..394fab2 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -7,3 +7,4 @@ add_check_test(torture_knownhosts torture_knownhosts.c ${TORTURE_LIBRARY}) add_check_test(torture_list torture_list.c ${TORTURE_LIBRARY}) add_check_test(torture_misc torture_misc.c ${TORTURE_LIBRARY}) add_check_test(torture_options torture_options.c ${TORTURE_LIBRARY}) +add_check_test(torture_rand torture_rand.c ${TORTURE_LIBRARY}) diff --git a/tests/unittests/torture_rand.c b/tests/unittests/torture_rand.c new file mode 100644 index 0000000..12dfab7 --- /dev/null +++ b/tests/unittests/torture_rand.c @@ -0,0 +1,49 @@ +#define LIBSSH_STATIC +#include +#include +#include "torture.h" + +#define NUM_LOOPS 50000 +#define NUM_THREADS 200 + +static void setup(){ + ssh_init(); +} + +static void *torture_rand_thread(void *threadid){ + char buffer[12]; + int i; + int r; + (void)threadid; + buffer[0]=buffer[1]=buffer[10]=buffer[11]='X'; + for(i=0;i