summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/stringConverter/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/stringConverter/Client.cpp')
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp17
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)
{