summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/stringConverter/Client.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2016-08-01 17:17:22 -0400
committerBernard Normier <bernard@zeroc.com>2016-08-01 17:17:22 -0400
commit3dc91ff6f82c9df33bf16d71dedbe8ff04e87c23 (patch)
treee9c3a1435776ab6cd695c8fd1159705aa60332f4 /cpp/test/Ice/stringConverter/Client.cpp
parentFixed iconv string converter (diff)
downloadice-3dc91ff6f82c9df33bf16d71dedbe8ff04e87c23.tar.bz2
ice-3dc91ff6f82c9df33bf16d71dedbe8ff04e87c23.tar.xz
ice-3dc91ff6f82c9df33bf16d71dedbe8ff04e87c23.zip
Pass argc/argv to communicators
Diffstat (limited to 'cpp/test/Ice/stringConverter/Client.cpp')
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp
index 8e42d6841c8..61b145a2539 100644
--- a/cpp/test/Ice/stringConverter/Client.cpp
+++ b/cpp/test/Ice/stringConverter/Client.cpp
@@ -26,6 +26,9 @@ main(int argc, char* argv[])
Ice::registerIceSSL();
#endif
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
+
string narrowEncoding;
string wideEncoding;
@@ -102,7 +105,8 @@ main(int argc, char* argv[])
setProcessWstringConverter(Ice::createIconvStringConverter<wchar_t>(wideEncoding));
#endif
- Ice::CommunicatorPtr communicator = Ice::initialize();
+
+ Ice::CommunicatorPtr communicator = Ice::initialize(initData);
Test::MyObjectPrxPtr proxy =
ICE_UNCHECKED_CAST(Test::MyObjectPrx,
communicator->stringToProxy("test:" + getTestEndpoint(communicator, 0)));
@@ -129,44 +133,40 @@ main(int argc, char* argv[])
Ice::setProcessStringConverter(ICE_NULLPTR);
Ice::setProcessWstringConverter(Ice::createUnicodeWstringConverter());
+
+ string propValue = "Ice:createStringConverter iconv=";
+ if(useIconv && !useLocale)
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties();
+ propValue += narrowEncoding + "," + wideEncoding;
+ }
+ propValue += " windows=28605";
- string propValue = "Ice:createStringConverter iconv=";
- if(useIconv && !useLocale)
- {
- propValue += narrowEncoding + "," + wideEncoding;
- }
- propValue += " windows=28605";
+ initData.properties->setProperty("Ice.Plugin.IceStringConverter", propValue);
- initData.properties->setProperty("Ice.Plugin.IceStringConverter", propValue);
+ Ice::CommunicatorPtr communicator = Ice::initialize(initData);
+ Test::MyObjectPrxPtr proxy =
+ ICE_UNCHECKED_CAST(Test::MyObjectPrx,
+ communicator->stringToProxy("test:" + getTestEndpoint(communicator, 0)));
- Ice::CommunicatorPtr communicator = Ice::initialize(initData);
- Test::MyObjectPrxPtr proxy =
- ICE_UNCHECKED_CAST(Test::MyObjectPrx,
- communicator->stringToProxy("test:" + getTestEndpoint(communicator, 0)));
-
- char oe = char(0xBD); // A single character in ISO Latin 9
- string msg = string("tu me fends le c") + oe + "ur!";
- cout << "testing string converter plug-in";
- if(useLocale)
- {
- cout << " (using locale)";
- }
- if(useIconv)
- {
- cout << " (using iconv)";
- }
- cout << "... " << flush;
- wstring wmsg = proxy->widen(msg);
- test(proxy->narrow(wmsg) == msg);
- test(wmsg.size() == msg.size());
- cout << "ok" << endl;
-
- proxy->shutdown();
- communicator->destroy();
+ char oe = char(0xBD); // A single character in ISO Latin 9
+ string msg = string("tu me fends le c") + oe + "ur!";
+ cout << "testing string converter plug-in";
+ if(useLocale)
+ {
+ cout << " (using locale)";
+ }
+ if(useIconv)
+ {
+ cout << " (using iconv)";
}
+ cout << "... " << flush;
+ wstring wmsg = proxy->widen(msg);
+ test(proxy->narrow(wmsg) == msg);
+ test(wmsg.size() == msg.size());
+ cout << "ok" << endl;
+
+ proxy->shutdown();
+ communicator->destroy();
return EXIT_SUCCESS;
}