summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/adapterDeactivation/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/adapterDeactivation/Client.cpp')
-rw-r--r--cpp/test/Ice/adapterDeactivation/Client.cpp51
1 files changed, 37 insertions, 14 deletions
diff --git a/cpp/test/Ice/adapterDeactivation/Client.cpp b/cpp/test/Ice/adapterDeactivation/Client.cpp
index b682a0a4fbf..9bc445e585a 100644
--- a/cpp/test/Ice/adapterDeactivation/Client.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Client.cpp
@@ -10,29 +10,52 @@
#include <Ice/Application.h>
#include <TestCommon.h>
#include <Test.h>
+#include <string>
+#include <iostream>
+
+DEFINE_TEST("client")
using namespace std;
using namespace Ice;
using namespace Test;
-class TestClient : public Application
-{
-public:
-
- virtual int run(int, char*[]);
-};
-
int
-main(int argc, char* argv[])
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
- TestClient app;
- return app.main(argc, argv);
+ TestIntfPrx allTests(const CommunicatorPtr&);
+ TestIntfPrx obj = allTests(communicator);
+ return EXIT_SUCCESS;
}
int
-TestClient::run(int argc, char* argv[])
+main(int argc, char* argv[])
{
- TestIntfPrx allTests(const CommunicatorPtr&);
- TestIntfPrx obj = allTests(communicator());
- return EXIT_SUCCESS;
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
}