summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/properties/Client.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2014-05-13 16:52:57 -0400
committerBernard Normier <bernard@zeroc.com>2014-05-13 16:52:57 -0400
commit3c9f5dc69d65b3f290a0de8c23184847fef41198 (patch)
treed884ccddefc9cd2f1057c63a60a0e0dc36e5931b /cpp/test/Ice/properties/Client.cpp
parentRemoved more unnecessary virtual inheritance from demos (diff)
downloadice-3c9f5dc69d65b3f290a0de8c23184847fef41198.tar.bz2
ice-3c9f5dc69d65b3f290a0de8c23184847fef41198.tar.xz
ice-3c9f5dc69d65b3f290a0de8c23184847fef41198.zip
Fixed ICE-5539 (C++ only) and added properties test for whitespace and escapes.
Diffstat (limited to 'cpp/test/Ice/properties/Client.cpp')
-rw-r--r--cpp/test/Ice/properties/Client.cpp53
1 files changed, 51 insertions, 2 deletions
diff --git a/cpp/test/Ice/properties/Client.cpp b/cpp/test/Ice/properties/Client.cpp
index cab96cf841e..d36a7b03f74 100644
--- a/cpp/test/Ice/properties/Client.cpp
+++ b/cpp/test/Ice/properties/Client.cpp
@@ -81,8 +81,7 @@ main(int argc, char* argv[])
Ice::PropertiesPtr properties;
Ice::StringSeq args;
args.push_back("--Ice.Config=config/config.1, config/config.2, config/config.3");
- IceUtilInternal::ArgVector a(args);
- properties = Ice::createProperties(a.argc, a.argv);
+ properties = Ice::createProperties(args);
test(properties->getProperty("Config1") == "Config1");
test(properties->getProperty("Config2") == "Config2");
test(properties->getProperty("Config3") == "Config3");
@@ -93,5 +92,55 @@ main(int argc, char* argv[])
cerr << ex << endl;
return EXIT_FAILURE;
}
+
+ try
+ {
+ cout << "testing configuration file escapes... " << flush;
+ Ice::PropertiesPtr properties;
+ Ice::StringSeq args;
+ args.push_back("--Ice.Config=config/escapes.cfg");
+ properties = Ice::createProperties(args);
+
+ string props[] = { "Foo\tBar", "3",
+ "Foo\\tBar", "4",
+ "Escape\\ Space", "2",
+ "Prop1", "1",
+ "Prop2", "2",
+ "Prop3", "3",
+ "My Prop1", "1",
+ "My Prop2", "2",
+ "My.Prop1", "a property",
+ "My.Prop2", "a property",
+ "My.Prop3", " a property ",
+ "My.Prop4", " a property ",
+ "My.Prop5", "a \\ property",
+ "foo=bar", "1",
+ "foo#bar", "2",
+ "foo bar", "3",
+ "A", "1",
+ "B", "2 3 4",
+ "C", "5=#6",
+ "AServer", "\\\\server\\dir",
+ "BServer", "\\server\\dir",
+ ""
+ } ;
+
+ for(size_t i = 0; props[i] != ""; i += 2)
+ {
+ cerr << "\n" << props[i] << "=\"" << props[i+1] << "\"" << endl;
+ cerr << props[i] << "=\"" << properties->getProperty(props[i]) << "\"" << endl;
+
+ test(properties->getProperty(props[i]) == props[i + 1]);
+ }
+
+ cout << "ok" << endl;
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ return EXIT_FAILURE;
+ }
+
+
return EXIT_SUCCESS;
}