diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-06-27 17:54:30 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-06-27 17:54:30 +0200 |
commit | c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7 (patch) | |
tree | 5cb64dfe155e5d2349efb6c7dc4b0f5b5284d44a /cpp/test/IceSSL/configuration/Client.cpp | |
parent | Fix Windows php build to restore nuget packages (diff) | |
download | ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.tar.bz2 ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.tar.xz ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.zip |
Refactored SSL and iAP transports, support for running SSL on top
of TCP/iAP/Bluetooth.
Diffstat (limited to 'cpp/test/IceSSL/configuration/Client.cpp')
-rw-r--r-- | cpp/test/IceSSL/configuration/Client.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/cpp/test/IceSSL/configuration/Client.cpp b/cpp/test/IceSSL/configuration/Client.cpp index 14538e7beac..68d3ad936e1 100644 --- a/cpp/test/IceSSL/configuration/Client.cpp +++ b/cpp/test/IceSSL/configuration/Client.cpp @@ -9,26 +9,51 @@ #include <Ice/Ice.h> #include <IceSSL/IceSSL.h> +#include <TestCommon.h> +#include <Test.h> + +DEFINE_TEST("client") using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { + string testdir; +#if TARGET_OS_IPHONE == 0 if(argc < 2) { cerr << "Usage: " << argv[0] << " testdir" << endl; return 1; } + testdir = argv[1]; +#endif - void allTests(const Ice::CommunicatorPtr&, const string&, bool, bool); - - cerr << "testing with PKCS12 certificates..." << endl; - allTests(communicator, argv[1], true, false); - cerr << "testing with PEM certificates..." << endl; - allTests(communicator, argv[1], false, true); + Test::ServerFactoryPrxPtr allTests(const Ice::CommunicatorPtr&, const string&, bool); + try + { + cerr << "testing with PKCS12 certificates..." << endl; + Test::ServerFactoryPrxPtr factory = allTests(communicator, testdir, true); +#if !defined(__APPLE__) || TARGET_OS_IPHONE == 0 + cerr << "testing with PEM certificates..." << endl; + factory = allTests(communicator, testdir, false); +#endif + if(factory) + { + factory->shutdown(); + } + } + catch(const IceSSL::CertificateReadException& ex) + { + cout << "couldn't read certificate: " << ex.reason << endl; + } + catch(const std::exception& ex) + { + cout << "unexpected exception: " << ex.what() << endl; + } return EXIT_SUCCESS; + } int |