fixed SF# 1670279

This commit is contained in:
Guenter Obiltschnig 2007-02-28 09:23:39 +00:00
parent 03d0ad4d8d
commit a8332eaaf3
2 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,7 @@
// //
// AbstractConfiguration.cpp // AbstractConfiguration.cpp
// //
// $Id: //poco/Main/Util/src/AbstractConfiguration.cpp#6 $ // $Id: //poco/Main/Util/src/AbstractConfiguration.cpp#7 $
// //
// Library: Util // Library: Util
// Package: Configuration // Package: Configuration
@ -328,7 +328,7 @@ std::string AbstractConfiguration::uncheckedExpand(const std::string& value) con
result.append("}"); result.append("}");
} }
} }
else result += *it++; else result += '$';
} }
else result += *it++; else result += *it++;
} }

View File

@ -1,7 +1,7 @@
// //
// AbstractConfigurationTest.cpp // AbstractConfigurationTest.cpp
// //
// $Id: //poco/Main/Util/testsuite/src/AbstractConfigurationTest.cpp#5 $ // $Id: //poco/Main/Util/testsuite/src/AbstractConfigurationTest.cpp#6 $
// //
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors. // and Contributors.
@ -193,6 +193,9 @@ void AbstractConfigurationTest::testExpand()
assert (pConf->expand("undef='${undef}'") == "undef='${undef}'"); assert (pConf->expand("undef='${undef}'") == "undef='${undef}'");
assert (pConf->expand("deep='${ref1}'") == "deep='foobar'"); assert (pConf->expand("deep='${ref1}'") == "deep='foobar'");
assert (pConf->expand("deep='${ref7}'") == "deep='foobar'"); assert (pConf->expand("deep='${ref7}'") == "deep='foobar'");
assert (pConf->getString("dollar.atend") == "foo$");
assert (pConf->getString("dollar.middle") == "foo$bar");
} }
@ -245,7 +248,7 @@ void AbstractConfigurationTest::testKeys()
AbstractConfiguration::Keys keys; AbstractConfiguration::Keys keys;
pConf->keys(keys); pConf->keys(keys);
assert (keys.size() == 11); assert (keys.size() == 12);
assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end()); assert (std::find(keys.begin(), keys.end(), "prop1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end()); assert (std::find(keys.begin(), keys.end(), "prop2") != keys.end());
assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end()); assert (std::find(keys.begin(), keys.end(), "prop3") != keys.end());
@ -257,6 +260,7 @@ void AbstractConfigurationTest::testKeys()
assert (std::find(keys.begin(), keys.end(), "ref5") != keys.end()); assert (std::find(keys.begin(), keys.end(), "ref5") != keys.end());
assert (std::find(keys.begin(), keys.end(), "ref6") != keys.end()); assert (std::find(keys.begin(), keys.end(), "ref6") != keys.end());
assert (std::find(keys.begin(), keys.end(), "ref7") != keys.end()); assert (std::find(keys.begin(), keys.end(), "ref7") != keys.end());
assert (std::find(keys.begin(), keys.end(), "dollar") != keys.end());
pConf->keys("prop1", keys); pConf->keys("prop1", keys);
assert (keys.empty()); assert (keys.empty());
@ -296,6 +300,8 @@ AbstractConfiguration* AbstractConfigurationTest::createConfiguration() const
pConfig->setString("ref5", "${refx}"); pConfig->setString("ref5", "${refx}");
pConfig->setString("ref6", "${refx"); pConfig->setString("ref6", "${refx");
pConfig->setString("ref7", "${ref1}"); pConfig->setString("ref7", "${ref1}");
pConfig->setString("dollar.atend", "foo$");
pConfig->setString("dollar.middle", "foo$bar");
return pConfig; return pConfig;
} }