diff options
author | Jose <jose@zeroc.com> | 2014-05-02 19:56:38 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-05-02 19:56:38 +0200 |
commit | 1161c5817059464ab511632c0ce5d14593ced1a3 (patch) | |
tree | 51bbcdf2a4ea43c430312157350bb4271bc3f40d /cpp/test | |
parent | Update .gitignore files (diff) | |
download | ice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.bz2 ice-1161c5817059464ab511632c0ce5d14593ced1a3.tar.xz ice-1161c5817059464ab511632c0ce5d14593ced1a3.zip |
ICE-4851 - Use wstrings for input and output data that contain non-ASCII characters?
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/custom/Client.cpp | 5 | ||||
-rw-r--r-- | cpp/test/Ice/custom/Collocated.cpp | 5 | ||||
-rw-r--r-- | cpp/test/Ice/custom/Server.cpp | 6 | ||||
-rw-r--r-- | cpp/test/Ice/custom/ServerAMD.cpp | 5 | ||||
-rw-r--r-- | cpp/test/Ice/custom/StringConverterI.cpp | 27 | ||||
-rw-r--r-- | cpp/test/Ice/custom/StringConverterI.h | 14 | ||||
-rw-r--r-- | cpp/test/Ice/stringConverter/Client.cpp | 105 | ||||
-rw-r--r-- | cpp/test/Ice/stringConverter/Makefile | 22 | ||||
-rw-r--r-- | cpp/test/Ice/stringConverter/Makefile.mak | 28 | ||||
-rw-r--r-- | cpp/test/Ice/stringConverter/Server.cpp | 96 | ||||
-rw-r--r-- | cpp/test/Ice/stringConverter/Test.ice | 2 | ||||
-rwxr-xr-x | cpp/test/Ice/stringConverter/run.py | 4 | ||||
-rw-r--r-- | cpp/test/IceGrid/Makefile.mak | 1 | ||||
-rw-r--r-- | cpp/test/IceGrid/deployer/Server.cpp | 6 | ||||
-rw-r--r-- | cpp/test/IceGrid/replicaGroup/Makefile | 2 | ||||
-rw-r--r-- | cpp/test/IceUtil/unicode/Client.cpp | 9 |
16 files changed, 200 insertions, 137 deletions
diff --git a/cpp/test/Ice/custom/Client.cpp b/cpp/test/Ice/custom/Client.cpp index d46b41e0860..6c5e737c5f7 100644 --- a/cpp/test/Ice/custom/Client.cpp +++ b/cpp/test/Ice/custom/Client.cpp @@ -34,9 +34,10 @@ main(int argc, char** argv) try { + IceUtil::setProcessStringConverter(new Test::StringConverterI()); + IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); + Ice::InitializationData initData; - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/Collocated.cpp b/cpp/test/Ice/custom/Collocated.cpp index 08f4319a9f6..0dfc28feb4f 100644 --- a/cpp/test/Ice/custom/Collocated.cpp +++ b/cpp/test/Ice/custom/Collocated.cpp @@ -40,11 +40,12 @@ main(int argc, char** argv) try { + IceUtil::setProcessStringConverter(new Test::StringConverterI()); + IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); + Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/Server.cpp b/cpp/test/Ice/custom/Server.cpp index e3705d15cfc..09d64eb0f2d 100644 --- a/cpp/test/Ice/custom/Server.cpp +++ b/cpp/test/Ice/custom/Server.cpp @@ -40,11 +40,13 @@ main(int argc, char** argv) try { + IceUtil::setProcessStringConverter(new Test::StringConverterI()); + IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); + Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/ServerAMD.cpp b/cpp/test/Ice/custom/ServerAMD.cpp index 46f240a0402..28f1e764a5c 100644 --- a/cpp/test/Ice/custom/ServerAMD.cpp +++ b/cpp/test/Ice/custom/ServerAMD.cpp @@ -40,12 +40,13 @@ main(int argc, char** argv) try { + IceUtil::setProcessStringConverter(new Test::StringConverterI()); + IceUtil::setProcessWstringConverter(new Test::WstringConverterI()); + Ice::InitializationData initData; initData.properties = Ice::createProperties(argc, argv); initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010"); - initData.stringConverter = new Test::StringConverterI(); - initData.wstringConverter = new Test::WstringConverterI(); communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } diff --git a/cpp/test/Ice/custom/StringConverterI.cpp b/cpp/test/Ice/custom/StringConverterI.cpp index e7469d4d755..dc1e2cfdbba 100644 --- a/cpp/test/Ice/custom/StringConverterI.cpp +++ b/cpp/test/Ice/custom/StringConverterI.cpp @@ -11,13 +11,14 @@ #include <IceUtil/Unicode.h> using namespace std; +using namespace IceUtil; -Ice::Byte* -Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, Ice::UTF8Buffer& buffer) const +Byte* +Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, IceUtil::UTF8Buffer& buffer) const { size_t size = static_cast<size_t>(sourceEnd - sourceStart); - Ice::Byte* targetStart = buffer.getMoreBytes(size, 0); - Ice::Byte* targetEnd = targetStart + size; + Byte* targetStart = buffer.getMoreBytes(size, 0); + Byte* targetEnd = targetStart + size; size_t j = size; for(size_t i = 0; i < size; ++i) @@ -29,7 +30,7 @@ Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, I } void -Test::StringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, +Test::StringConverterI::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, string& target) const { size_t size = static_cast<size_t>(sourceEnd - sourceStart); @@ -43,26 +44,26 @@ Test::StringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* } -Ice::Byte* -Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, Ice::UTF8Buffer& buffer) const +Byte* +Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourceEnd, IceUtil::UTF8Buffer& buffer) const { wstring ws(sourceStart, sourceEnd); - string s = IceUtil::wstringToString(ws); + string s = IceUtil::wnativeToNative(0, 0, ws); size_t size = s.size(); - Ice::Byte* targetStart = buffer.getMoreBytes(size, 0); - Ice::Byte* targetEnd = targetStart + size; + Byte* targetStart = buffer.getMoreBytes(size, 0); + Byte* targetEnd = targetStart + size; size_t j = size; for(size_t i = 0; i < size; ++i) { - targetStart[i] = static_cast<Ice::Byte>(s[--j]); + targetStart[i] = static_cast<Byte>(s[--j]); } return targetEnd; } void -Test::WstringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, +Test::WstringConverterI::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, wstring& target) const { size_t size = static_cast<size_t>(sourceEnd - sourceStart); @@ -75,6 +76,6 @@ Test::WstringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* s[i] = sourceStart[--j]; } - target = IceUtil::stringToWstring(s); + target = IceUtil::nativeToWnative(0, 0, s); } diff --git a/cpp/test/Ice/custom/StringConverterI.h b/cpp/test/Ice/custom/StringConverterI.h index 42d2ff6fa36..67ace8d90cd 100644 --- a/cpp/test/Ice/custom/StringConverterI.h +++ b/cpp/test/Ice/custom/StringConverterI.h @@ -10,7 +10,7 @@ #ifndef STRING_CONVERTER_I_H #define STRING_CONVERTER_I_H -#include <Ice/StringConverter.h> +#include <IceUtil/StringConverter.h> // // Simple contrived string converters which simply reverse the order of the @@ -20,21 +20,21 @@ namespace Test { -class StringConverterI : public Ice::StringConverter +class StringConverterI : public IceUtil::StringConverter { public: - virtual Ice::Byte* toUTF8(const char*, const char*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, + virtual IceUtil::Byte* toUTF8(const char*, const char*, IceUtil::UTF8Buffer&) const; + virtual void fromUTF8(const IceUtil::Byte* sourceStart, const IceUtil::Byte* sourceEnd, std::string& target) const; }; -class WstringConverterI : public Ice::WstringConverter +class WstringConverterI : public IceUtil::WstringConverter { public: - virtual Ice::Byte* toUTF8(const wchar_t*, const wchar_t*, Ice::UTF8Buffer&) const; - virtual void fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte* sourceEnd, + virtual IceUtil::Byte* toUTF8(const wchar_t*, const wchar_t*, IceUtil::UTF8Buffer&) const; + virtual void fromUTF8(const IceUtil::Byte* sourceStart, const IceUtil::Byte* sourceEnd, std::wstring& target) const; }; diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index f653055adac..eb59598691d 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -11,13 +11,6 @@ #include <TestCommon.h> #include <Test.h> -#if defined(ICONV_ON_WINDOWS) -// -// On Windows, Ice/IcongStringConverter.h is not included by Ice/Ice.h -// -#include <Ice/IconvStringConverter.h> -#endif - #include <iostream> #include <locale.h> @@ -30,31 +23,6 @@ public: virtual int run(int, char*[]); }; -// -// Server side is pure unicode -// -class MyObjectI : public Test::MyObject -{ -public: - - virtual wstring widen(const string& msg, const Ice::Current&) - { - const Ice::Byte* cmsg = reinterpret_cast<const Ice::Byte*>(msg.c_str()); - - if(!IceUtil::isLegalUTF8Sequence(cmsg, cmsg + msg.size())) - { - throw Test::BadEncodingException(); - } - - return IceUtil::stringToWstring(msg); - } - - virtual string narrow(const wstring& wmsg, const Ice::Current&) - { - return IceUtil::wstringToString(wmsg); - } -}; - static bool useLocale = false; static bool useIconv = true; @@ -67,87 +35,68 @@ main(int argc, char* argv[]) // // Switch to French locale // (we just used the codeset for as default internal code for - // initData.stringConverter below) + // stringConverter below) // useLocale = (setlocale(LC_ALL, "fr_FR.ISO8859-15") != 0 || setlocale(LC_ALL, "fr_FR.iso885915@euro") != 0); #endif - - Ice::InitializationData initData; -#if defined(_WIN32) && !defined(ICONV_ON_WINDOWS) +#if defined(_WIN32) // // 28605 == ISO 8859-15 codepage // - initData.stringConverter = new Ice::WindowsStringConverter(28605); + IceUtil::setProcessStringConverter(new IceUtil::WindowsStringConverter(28605)); useIconv = false; #elif defined(__hpux) if(useLocale) { - initData.stringConverter = new Ice::IconvStringConverter<char>; + IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>); } else { - initData.stringConverter = new Ice::IconvStringConverter<char>("iso815"); + IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>("iso815")); } - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("ucs4"); + IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("ucs4")); #else if(useLocale) { -#ifndef _WIN32 - initData.stringConverter = new Ice::IconvStringConverter<char>; -#endif + IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>()); } else { - initData.stringConverter = new Ice::IconvStringConverter<char>("ISO8859-15"); + IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>("ISO8859-15")); } if(sizeof(wchar_t) == 4) { -#ifdef ICE_BIG_ENDIAN - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-32BE"); -#else - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-32LE"); -#endif +# ifdef ICE_BIG_ENDIAN + IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-32BE")); +# else + IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-32LE")); +# endif } else { -#ifdef ICE_BIG_ENDIAN - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-16BE"); -#else - initData.wstringConverter = new Ice::IconvStringConverter<wchar_t>("UTF-16LE"); -#endif +# ifdef ICE_BIG_ENDIAN + IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-16BE")); +# else + IceUtil::setProcessWstringConverter(new IceUtil::IconvStringConverter<wchar_t>("UTF-16LE")); +# endif } #endif - return app.main(argc, argv, initData); + return app.main(argc, argv); } int Client::run(int, char*[]) { - // - // Create server communicator and OA - // - Ice::InitializationData initData; - initData.properties = communicator()->getProperties()->clone(); - Ice::CommunicatorPtr serverCommunicator = Ice::initialize(initData); - Ice::ObjectAdapterPtr oa = serverCommunicator->createObjectAdapterWithEndpoints("MyOA", "tcp -h localhost"); - - Ice::ObjectPtr servant = new MyObjectI; - Test::MyObjectPrx serverPrx = Test::MyObjectPrx::uncheckedCast(oa->addWithUUID(servant)); - oa->activate(); - - // - // Get a prx in the client's communicator - // - Test::MyObjectPrx clientPrx = - Test::MyObjectPrx::uncheckedCast(communicator()->stringToProxy(serverPrx->ice_toString())); + Test::MyObjectPrx proxy = + Test::MyObjectPrx::uncheckedCast(communicator()->stringToProxy("test:default -h localhost -p 12010")); - char oe = char(0xBD); // A single character in ISO Latin 9 + 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"; if(useLocale) @@ -159,14 +108,10 @@ Client::run(int, char*[]) cout << " (using iconv)"; } cout << "... " << flush; - wstring wmsg = clientPrx->widen(msg); - test(clientPrx->narrow(wmsg) == msg); + wstring wmsg = proxy->widen(msg); + test(proxy->narrow(wmsg) == msg); test(wmsg.size() == msg.size()); cout << "ok" << endl; - - // - // destroy server communicator - // - serverCommunicator->destroy(); + proxy->shutdown(); return EXIT_SUCCESS; } diff --git a/cpp/test/Ice/stringConverter/Makefile b/cpp/test/Ice/stringConverter/Makefile index 0a484407695..c86cfb4a3b5 100644 --- a/cpp/test/Ice/stringConverter/Makefile +++ b/cpp/test/Ice/stringConverter/Makefile @@ -10,22 +10,32 @@ top_srcdir = ../../.. CLIENT = $(call mktestname,client) +SERVER = $(call mktestname,server) -TARGETS = $(CLIENT) +TARGETS = $(CLIENT) $(SERVER) -OBJS = Test.o \ - Client.o +COBJS = Test.o \ + Client.o -SRCS = $(OBJS:.o=.cpp) +SOBJS = Test.o \ + Server.o + +SRCS = $(COBJS:.o=.cpp) \ + $(SOBJS:.o=.cpp) SLICE_SRCS = Test.ice + include $(top_srcdir)/config/Make.rules CPPFLAGS := -I. -I../../include $(CPPFLAGS) -$(CLIENT): $(OBJS) +$(CLIENT): $(COBJS) + rm -f $@ + $(call mktest,$@,$(COBJS),$(OPENSSL_RPATH_LINK) $(ICESSL_LIBS) $(ICEWS_LIBS)) + +$(SERVER): $(SOBJS) rm -f $@ - $(call mktest,$@,$(OBJS),$(LIBS) $(ICONV_LIBS)) + $(call mktest,$@,$(SOBJS),$(ICESSL_LIBS) $(ICEWS_LIBS)) include .depend diff --git a/cpp/test/Ice/stringConverter/Makefile.mak b/cpp/test/Ice/stringConverter/Makefile.mak index b03a42eedb5..619bb89ad5c 100644 --- a/cpp/test/Ice/stringConverter/Makefile.mak +++ b/cpp/test/Ice/stringConverter/Makefile.mak @@ -10,32 +10,38 @@ top_srcdir = ..\..\.. CLIENT = client.exe +SERVER = server.exe -TARGETS = $(CLIENT) +TARGETS = $(CLIENT) $(SERVER) -OBJS = Client.obj \ - Test.obj +OBJS = Test.obj + +COBJS = Client.obj + +SOBJS = Server.obj SRCS = $(OBJS:.obj=.cpp) !include $(top_srcdir)/config/Make.rules.mak CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -!if "$(ICONV_HOME)" != "" -CPPFLAGS = $(CPPFLAGS) -I$(ICONV_HOME)\include -DICONV_ON_WINDOWS -DICE_NO_ERRNO -LIBS = $(LIBS) -LIBPATH:$(ICONV_HOME)\lib $(ICONV_LIB) -!endif !if "$(GENERATE_PDB)" == "yes" -PDBFLAGS = /pdb:$(CLIENT:.exe=.pdb) +CPDBFLAGS = /pdb:$(CLIENT).pdb +SPDBFLAGS = /pdb:$(SERVER).pdb !endif -$(CLIENT): $(OBJS) - $(LINK) $(LD_EXEFLAGS) $(PDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) +$(CLIENT): $(COBJS) $(OBJS) + $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) + @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ + $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest + +$(SERVER): $(SOBJS) $(OBJS) + $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBNAME) $(LIBS) @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest -all:: $(CLIENT) +all:: $(TARGETS) clean:: del /q Test.cpp Test.h diff --git a/cpp/test/Ice/stringConverter/Server.cpp b/cpp/test/Ice/stringConverter/Server.cpp new file mode 100644 index 00000000000..4b9c6a78c20 --- /dev/null +++ b/cpp/test/Ice/stringConverter/Server.cpp @@ -0,0 +1,96 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestCommon.h> +#include <Test.h> + +DEFINE_TEST("server"); + +using namespace std; + +// +// Server side is pure unicode +// +class MyObjectI : public Test::MyObject +{ +public: + + virtual wstring widen(const string& msg, const Ice::Current&) + { + const Ice::Byte* cmsg = reinterpret_cast<const Ice::Byte*>(msg.c_str()); + + if(!IceUtil::isLegalUTF8Sequence(cmsg, cmsg + msg.size())) + { + throw Test::BadEncodingException(); + } + + return IceUtil::nativeToWnative(IceUtil::getProcessStringConverter(), + IceUtil::getProcessWstringConverter(), msg); + } + + virtual string narrow(const wstring& wmsg, const Ice::Current&) + { + return IceUtil::wnativeToNative(IceUtil::getProcessStringConverter(), + IceUtil::getProcessWstringConverter(), wmsg); + } + + virtual void shutdown(const Ice::Current& current) + { + current.adapter->getCommunicator()->shutdown(); + } +}; + +int +run(int, char**, const Ice::CommunicatorPtr& communicator) +{ + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + adapter->add(new MyObjectI, communicator->stringToIdentity("test")); + adapter->activate(); + + TEST_READY + communicator->waitForShutdown(); + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + 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; +} diff --git a/cpp/test/Ice/stringConverter/Test.ice b/cpp/test/Ice/stringConverter/Test.ice index 3c8d19d4342..2a9df0fe395 100644 --- a/cpp/test/Ice/stringConverter/Test.ice +++ b/cpp/test/Ice/stringConverter/Test.ice @@ -18,6 +18,8 @@ interface MyObject { ["cpp:type:wstring"] string widen(string msg) throws BadEncodingException; string narrow(["cpp:type:wstring"] string wmsg); + + void shutdown(); }; }; diff --git a/cpp/test/Ice/stringConverter/run.py b/cpp/test/Ice/stringConverter/run.py index eed9bface4f..33fc2e8f3ac 100755 --- a/cpp/test/Ice/stringConverter/run.py +++ b/cpp/test/Ice/stringConverter/run.py @@ -20,6 +20,4 @@ if len(path) == 0: sys.path.append(os.path.join(path[0], "scripts")) import TestUtil -client = os.path.join(os.getcwd(), "client") - -TestUtil.simpleTest(client) +TestUtil.clientServerTest() diff --git a/cpp/test/IceGrid/Makefile.mak b/cpp/test/IceGrid/Makefile.mak index ecea19801a9..a33cdafc4be 100644 --- a/cpp/test/IceGrid/Makefile.mak +++ b/cpp/test/IceGrid/Makefile.mak @@ -17,7 +17,6 @@ SUBDIRS = activation \ allocation \ deployer \ distribution \ - fileLock \ noRestartUpdate \ replicaGroup \ replication \ diff --git a/cpp/test/IceGrid/deployer/Server.cpp b/cpp/test/IceGrid/deployer/Server.cpp index 7673e082a6e..3d576116fa4 100644 --- a/cpp/test/IceGrid/deployer/Server.cpp +++ b/cpp/test/IceGrid/deployer/Server.cpp @@ -80,13 +80,13 @@ main(int argc, char* argv[]) #if defined(_WIN32) wchar_t* value2 = _wgetenv(L"MY_ENV_UNICODE_VARIABLE"); - test(value2 != 0 && wstring(value2) == IceUtil::stringToWstring(unicodeVar)); + test(value2 != 0 && wstring(value2) == IceUtil::nativeToWnative(0, 0, unicodeVar)); - wchar_t* value3 = _wgetenv(IceUtil::stringToWstring(varname1).c_str()); + wchar_t* value3 = _wgetenv(IceUtil::nativeToWnative(0, 0, varname1).c_str()); test(value3 != 0 && wstring(value3) == L"2"); // Environment variables are case insensitive on Windows. - wchar_t* value4 = _wgetenv(IceUtil::stringToWstring(varname1).c_str()); + wchar_t* value4 = _wgetenv(IceUtil::nativeToWnative(0, 0, varname1).c_str()); test(value4 != 0 && wstring(value4) == L"2"); char* value5 = getenv("MY_WINDOWS_COMPOSED_VARIABLE"); diff --git a/cpp/test/IceGrid/replicaGroup/Makefile b/cpp/test/IceGrid/replicaGroup/Makefile index fc64b7f3c1f..aa9d9238ee9 100644 --- a/cpp/test/IceGrid/replicaGroup/Makefile +++ b/cpp/test/IceGrid/replicaGroup/Makefile @@ -18,7 +18,7 @@ SVCSONAME = $(call mksoname,TestService) PLUGINFILENAME = $(call mklibfilename,RegistryPlugin,$(VERSION)) PLUGINSONAME = $(call mksoname,RegistryPlugin,$(SOVERSION)) -TARGETS = $(CLIENT) $(SERVER) $(SVCFILENAME ) $(call mklibtargets,$(PLUGINFILENAME),$(PLUGINSONAME)) +TARGETS = $(CLIENT) $(SERVER) $(SVCFILENAME) $(call mklibtargets,$(PLUGINFILENAME),$(PLUGINSONAME)) OBJS = Test.o diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp index db569292aa5..94f568ff334 100644 --- a/cpp/test/IceUtil/unicode/Client.cpp +++ b/cpp/test/IceUtil/unicode/Client.cpp @@ -9,6 +9,7 @@ #include <IceUtil/Unicode.h> #include <IceUtil/FileUtil.h> +#include <IceUtil/StringConverter.h> #include <TestCommon.h> #ifdef _WIN32 @@ -21,7 +22,7 @@ using namespace IceUtil; using namespace std; // -// Note that each file starts with a BOM; stringToWstring and wstringToString +// Note that each file starts with a BOM; nativeToWnative and wnativeToNative // converts these BOMs back and forth. // @@ -47,7 +48,7 @@ main(int argc, char* argv[]) # ifdef __MINGW32__ dir = argv[1]; # else - dir = IceUtil::wstringToString(argv[1]); + dir = IceUtil::wnativeToNative(0, 0, argv[1]); # endif dir += "\\"; #else @@ -83,7 +84,7 @@ main(int argc, char* argv[]) test(isLegalUTF8Sequence(reinterpret_cast<const Byte*>(line.data()), reinterpret_cast<const Byte*>(line.data() + line.size()))); lineNumber++; - wstring wline = stringToWstring(line); + wstring wline = nativeToWnative(0, 0, line); for(size_t i = 0; i < wline.length(); ++i) { @@ -156,7 +157,7 @@ main(int argc, char* argv[]) } } while(bis.good()); - string s = wstringToString(ws); + string s = wnativeToNative(0, 0, ws); IceUtilInternal::ifstream nbis((dir + "coeur.utf8"), ios_base::binary); test(nbis.good()); |