2007-06-10 07:55:43 +00:00
|
|
|
#include "CookieBoxFactory.h"
|
2008-03-03 11:30:12 +00:00
|
|
|
#include <iostream>
|
2006-02-17 13:35:04 +00:00
|
|
|
#include <cppunit/CompilerOutputter.h>
|
|
|
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
|
|
|
#include <cppunit/ui/text/TestRunner.h>
|
2008-02-21 02:21:14 +00:00
|
|
|
#ifdef HAVE_LIBSSL
|
|
|
|
# include <openssl/err.h>
|
|
|
|
# include <openssl/ssl.h>
|
|
|
|
#endif // HAVE_LIBSSL
|
|
|
|
#ifdef HAVE_LIBGNUTLS
|
|
|
|
# include <gnutls/gnutls.h>
|
|
|
|
#endif // HAVE_LIBGNUTLS
|
2006-02-17 13:35:04 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
using aria2::SharedHandle;
|
|
|
|
using aria2::SingletonHolder;
|
|
|
|
|
2006-02-17 13:35:04 +00:00
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
CppUnit::Test* suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
|
|
|
|
CppUnit::TextUi::TestRunner runner;
|
|
|
|
runner.addTest(suite);
|
|
|
|
|
|
|
|
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
|
|
|
|
|
2007-06-10 07:55:43 +00:00
|
|
|
// setup
|
2008-02-21 02:21:14 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBSSL
|
|
|
|
// for SSL initialization
|
|
|
|
SSL_load_error_strings();
|
|
|
|
SSL_library_init();
|
|
|
|
#endif // HAVE_LIBSSL
|
|
|
|
#ifdef HAVE_LIBGNUTLS
|
|
|
|
gnutls_global_init();
|
|
|
|
#endif // HAVE_LIBGNUTLS
|
|
|
|
|
2008-04-20 00:50:22 +00:00
|
|
|
SharedHandle<aria2::CookieBoxFactory> cookieBoxFactory
|
|
|
|
(new aria2::CookieBoxFactory());
|
2008-02-08 15:53:45 +00:00
|
|
|
SingletonHolder<SharedHandle<aria2::CookieBoxFactory> >::instance(cookieBoxFactory);
|
2007-06-10 07:55:43 +00:00
|
|
|
|
2006-02-17 13:35:04 +00:00
|
|
|
// Run the tests.
|
|
|
|
bool successfull = runner.run();
|
|
|
|
|
2008-02-21 02:21:14 +00:00
|
|
|
#ifdef HAVE_LIBGNUTLS
|
|
|
|
gnutls_global_deinit();
|
|
|
|
#endif // HAVE_LIBGNUTLS
|
|
|
|
|
2006-02-17 13:35:04 +00:00
|
|
|
return successfull ? 0 : 1;
|
|
|
|
}
|