summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/servantLocator/Client.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2013-07-02 15:21:36 +0200
committerBenoit Foucher <benoit@zeroc.com>2013-07-02 15:21:36 +0200
commit655725cdbeaf94cbce6c38818cdffbb2f7e507ae (patch)
tree0cd4501cfce7ad52fd1afc5c959f17297599708c /cpp/test/Ice/servantLocator/Client.cpp
parentWorked around optional test failure when compiled with -O2 on iPhone (diff)
downloadice-655725cdbeaf94cbce6c38818cdffbb2f7e507ae.tar.bz2
ice-655725cdbeaf94cbce6c38818cdffbb2f7e507ae.tar.xz
ice-655725cdbeaf94cbce6c38818cdffbb2f7e507ae.zip
Integrated minor test changes from Ice Touch branch
Diffstat (limited to 'cpp/test/Ice/servantLocator/Client.cpp')
-rw-r--r--cpp/test/Ice/servantLocator/Client.cpp54
1 files changed, 38 insertions, 16 deletions
diff --git a/cpp/test/Ice/servantLocator/Client.cpp b/cpp/test/Ice/servantLocator/Client.cpp
index b96494090bb..8f5d78d8b04 100644
--- a/cpp/test/Ice/servantLocator/Client.cpp
+++ b/cpp/test/Ice/servantLocator/Client.cpp
@@ -11,29 +11,51 @@
#include <TestCommon.h>
#include <Test.h>
+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, char**, const Ice::CommunicatorPtr& communicator)
{
- TestClient app;
- return app.main(argc, argv);
+ TestIntfPrx allTests(const Ice::CommunicatorPtr&, bool);
+ TestIntfPrx obj = allTests(communicator, false);
+ obj->shutdown();
+ return EXIT_SUCCESS;
}
int
-TestClient::run(int, char**)
+main(int argc, char* argv[])
{
- TestIntfPrx allTests(const CommunicatorPtr&, bool);
- TestIntfPrx obj = allTests(communicator(), false);
- obj->shutdown();
- return EXIT_SUCCESS;
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
+ 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;
}