diff options
author | Jose <jose@zeroc.com> | 2018-06-01 17:41:03 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-06-01 17:41:03 +0200 |
commit | cbe92e540a7f02f0bdf93192424bd119189365b7 (patch) | |
tree | 411c50dc0ae9c669d31a940b1b4903b5deac4f12 /cpp/test/Ice/slicing/objects/ServerAMD.cpp | |
parent | Fixed Util.py check for binary installation directory on Windows (diff) | |
download | ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.bz2 ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.xz ice-cbe92e540a7f02f0bdf93192424bd119189365b7.zip |
Do not use Ice::Application for Ice testsuite
Diffstat (limited to 'cpp/test/Ice/slicing/objects/ServerAMD.cpp')
-rw-r--r-- | cpp/test/Ice/slicing/objects/ServerAMD.cpp | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/cpp/test/Ice/slicing/objects/ServerAMD.cpp b/cpp/test/Ice/slicing/objects/ServerAMD.cpp index 44d627ea95b..7898b8087ee 100644 --- a/cpp/test/Ice/slicing/objects/ServerAMD.cpp +++ b/cpp/test/Ice/slicing/objects/ServerAMD.cpp @@ -9,47 +9,33 @@ #include <Ice/Ice.h> #include <TestAMDI.h> -#include <TestCommon.h> +#include <TestHelper.h> using namespace std; -DEFINE_TEST("serveramd") +class ServerAMD : public Test::TestHelper +{ +public: + + void run(int, char**); +}; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +void +ServerAMD::run(int argc, char** argv) { - Ice::PropertiesPtr properties = communicator->getProperties(); - properties->setProperty("Ice.Warn.Dispatch", "0"); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 2000"); + Ice::PropertiesPtr properties = createTestProperties(argc, argv); +#ifndef ICE_CPP11_MAPPING + properties->setProperty("Ice.CollectObjects", "1"); +#endif + Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); + communicator->getProperties()->setProperty("Ice.Warn.Dispatch", "0"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint() + " -t 2000"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = ICE_MAKE_SHARED(TestI); adapter->add(object, Ice::stringToIdentity("Test")); adapter->activate(); - TEST_READY + serverReady(); communicator->waitForShutdown(); - return EXIT_SUCCESS; } -int -main(int argc, char* argv[]) -{ -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(false); - Ice::registerIceWS(true); -#endif - - try - { - Ice::InitializationData initData = getTestInitData(argc, argv); -#ifndef ICE_CPP11_MAPPING - initData.properties->setProperty("Ice.CollectObjects", "1"); -#endif - Ice::CommunicatorHolder ich(argc, argv, initData); - return run(argc, argv, ich.communicator()); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - return EXIT_FAILURE; - } -} +DEFINE_TEST(ServerAMD) |