diff --git a/libretroshare/src/tests/services/forum_test.cc b/libretroshare/src/tests/services/forum_test.cc deleted file mode 100644 index f4e3fb653..000000000 --- a/libretroshare/src/tests/services/forum_test.cc +++ /dev/null @@ -1,152 +0,0 @@ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -/**************** PQI_USE_XPGP ******************/ -#if defined(PQI_USE_XPGP) - #include -#else /* X509 Certificates */ -/**************** PQI_USE_XPGP ******************/ - -#endif /* X509 Certificates */ -/**************** PQI_USE_XPGP ******************/ - -#include - -#include -#include - -static BIO *bio_err=NULL; - -#include "p3forums.h" - -int testForums(p3Forums *forum); - -int main(int argc, char **argv) -{ - - /* setup SSL */ - bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); - - - /* enable memory leak checking unless explicitly disabled */ - CRYPTO_malloc_debug_init(); - CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); - CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - - SSL_library_init(); - SSL_load_error_strings(); - - - /* setup p3Forums */ - uint16_t type = 1; - CacheStrapper *cs = NULL; - CacheTransfer *cft = NULL; - std::string srcdir = "./"; - std::string storedir = "./"; - - p3AuthMgr *dAuthMgr = new p3DummyAuthMgr(); - p3Forums *forum = new p3Forums(type, cs, cft, srcdir, storedir, dAuthMgr); - - testForums(forum); - - int i; - for(i = 0; i < 10; i++) - { -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - forum->tick(); - } - - /* cleanup */ - CRYPTO_cleanup_all_ex_data(); - ERR_free_strings(); - ERR_remove_state(0); - EVP_cleanup(); - //CRYPTO_mem_leaks(bio_err); - if (bio_err != NULL) BIO_free(bio_err); - - return 1; -} - - -int testForums(p3Forums *forum) -{ - std::string fId1 = forum->createForum(L"Forum 1", L"first forum", RS_DISTRIB_PUBLIC); - - forum->tick(); /* expect group publish */ -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - forum->tick(); -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - - std::string fId2 = forum->createForum(L"Forum 2", L"next first forum", RS_DISTRIB_PRIVATE); - - forum->tick(); /* expect group publish */ -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - forum->tick(); -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - - std::string mId1 = forum->createForumMsg(fId2, "", L"Forum 2 Msg 1", L"first forum msg", true); - - forum->tick(); /* expect msg publish */ -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - forum->tick(); -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - - std::string mId2 = forum->createForumMsg(fId2, "", L"Forum 2 Msg 2", L"second forum msg", false); - - forum->tick(); /* expect msg publish */ -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - forum->tick(); -#ifdef WIN32 - Sleep(1000); -#else - sleep(1); -#endif - return 1 ; -} -