mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
suppressing redundant file forum_test (content transferred to distrib_test)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3711 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fc593ccf50
commit
c7348017b5
@ -1,152 +0,0 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
|
||||
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
#if defined(PQI_USE_XPGP)
|
||||
#include <openssl/xPGP.h>
|
||||
#else /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
||||
#endif /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user