|
@@ -1,20 +1,22 @@
|
|
|
+#include "Platform.h"
|
|
|
#include "CookieBoxFactory.h"
|
|
|
#include <iostream>
|
|
|
#include <cppunit/CompilerOutputter.h>
|
|
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
|
|
#include <cppunit/ui/text/TestRunner.h>
|
|
|
-#ifdef HAVE_LIBSSL
|
|
|
-# include <openssl/err.h>
|
|
|
-# include <openssl/ssl.h>
|
|
|
-#endif // HAVE_LIBSSL
|
|
|
-#ifdef HAVE_LIBGNUTLS
|
|
|
-# include <gnutls/gnutls.h>
|
|
|
-#endif // HAVE_LIBGNUTLS
|
|
|
|
|
|
using aria2::SharedHandle;
|
|
|
using aria2::SingletonHolder;
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
+ aria2::Platform platform;
|
|
|
+
|
|
|
+#ifdef ENABLE_NLS
|
|
|
+ // Set locale to C to prevent the messages to be localized.
|
|
|
+ setlocale (LC_CTYPE, "C");
|
|
|
+ setlocale (LC_MESSAGES, "C");
|
|
|
+#endif // ENABLE_NLS
|
|
|
+
|
|
|
CppUnit::Test* suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
|
|
|
CppUnit::TextUi::TestRunner runner;
|
|
|
runner.addTest(suite);
|
|
@@ -23,15 +25,6 @@ int main(int argc, char* argv[]) {
|
|
|
|
|
|
// setup
|
|
|
|
|
|
-#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
|
|
|
-
|
|
|
SharedHandle<aria2::CookieBoxFactory> cookieBoxFactory
|
|
|
(new aria2::CookieBoxFactory());
|
|
|
SingletonHolder<SharedHandle<aria2::CookieBoxFactory> >::instance(cookieBoxFactory);
|
|
@@ -39,9 +32,5 @@ int main(int argc, char* argv[]) {
|
|
|
// Run the tests.
|
|
|
bool successfull = runner.run();
|
|
|
|
|
|
-#ifdef HAVE_LIBGNUTLS
|
|
|
- gnutls_global_deinit();
|
|
|
-#endif // HAVE_LIBGNUTLS
|
|
|
-
|
|
|
return successfull ? 0 : 1;
|
|
|
}
|