summaryrefslogtreecommitdiff
path: root/cpp/test/IceSSL/configuration/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/IceSSL/configuration/Client.cpp')
-rw-r--r--cpp/test/IceSSL/configuration/Client.cpp37
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