diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-10-20 21:03:44 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-10-20 21:03:44 -0400 |
commit | 3cb9c15995b828c52dba34d0a222f572d5bbc41b (patch) | |
tree | 87bad249c2ee04972be5f3c7635880cb0c556128 /cpp/test/Ice/stringConverter/Client.cpp | |
parent | updating IceBT to BlueZ 5 (diff) | |
download | ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.tar.bz2 ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.tar.xz ice-3cb9c15995b828c52dba34d0a222f572d5bbc41b.zip |
Added support for non-ASCII characters and universal character names
to stringified identities and proxies.
This includes a new Ice.ToStringMode property.
Diffstat (limited to 'cpp/test/Ice/stringConverter/Client.cpp')
-rw-r--r-- | cpp/test/Ice/stringConverter/Client.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index 4a8e7027aea..f0d7f4df1cd 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -127,6 +127,22 @@ main(int argc, char* argv[]) wstring wmsg = proxy->widen(msg); test(proxy->narrow(wmsg) == msg); test(wmsg.size() == msg.size()); + + // Test stringToIdentity and identityToString + + string identStr = "cat/" + msg; + Ice::Identity ident = Ice::stringToIdentity(identStr); + test(ident.name == msg); + test(ident.category == "cat"); + test(identityToString(ident, Ice::ICE_ENUM(ToStringMode, Unicode)) == identStr); + + identStr = identityToString(ident, Ice::ICE_ENUM(ToStringMode, ASCII)); + test(identStr == "cat/tu me fends le c\\u0153ur!"); + test(Ice::stringToIdentity(identStr) == ident); + identStr = identityToString(ident, Ice::ICE_ENUM(ToStringMode, Compat)); + test(identStr == "cat/tu me fends le c\\305\\223ur!"); + test(Ice::stringToIdentity(identStr) == ident); + communicator->destroy(); cout << "ok" << endl; } @@ -134,7 +150,6 @@ main(int argc, char* argv[]) Ice::setProcessStringConverter(ICE_NULLPTR); Ice::setProcessWstringConverter(Ice::createUnicodeWstringConverter()); - string propValue = "Ice:createStringConverter"; if(useIconv && !useLocale) { |