added tests from 1.4.4 (rev. 1918)

This commit is contained in:
Aleksandar Fabijanic 2012-08-19 02:02:49 +00:00
Родитель 47aadf0681
Коммит 7a50c8ee0a
1 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -84,6 +84,36 @@ void WinConfigurationTest::testConfiguration()
std::string value;
assert (pReg->convertToRegFormat("A.B.C", value) == "A\\B");
assert (value == "C");
Poco::Util::AbstractConfiguration::Keys keys;
pReg->keys(keys);
assert (keys.size() == 3);
assert (std::find(keys.begin(), keys.end(), "name1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "name2") != keys.end());
assert (std::find(keys.begin(), keys.end(), "config") != keys.end());
pReg->keys("config", keys);
assert (keys.size() == 1);
assert (std::find(keys.begin(), keys.end(), "sub") != keys.end());
AutoPtr<WinRegistryConfiguration> pRootReg = new WinRegistryConfiguration("");
assert (pRootReg->getInt("HKEY_CURRENT_USER.Software.Applied Informatics.Test.name1") == 1);
pRootReg->keys(keys);
assert (keys.size() == 6);
assert (std::find(keys.begin(), keys.end(), "HKEY_CLASSES_ROOT") != keys.end());
assert (std::find(keys.begin(), keys.end(), "HKEY_CURRENT_CONFIG") != keys.end());
assert (std::find(keys.begin(), keys.end(), "HKEY_CURRENT_USER") != keys.end());
assert (std::find(keys.begin(), keys.end(), "HKEY_LOCAL_MACHINE") != keys.end());
assert (std::find(keys.begin(), keys.end(), "HKEY_PERFORMANCE_DATA") != keys.end());
assert (std::find(keys.begin(), keys.end(), "HKEY_USERS") != keys.end());
pRootReg->keys("HKEY_CURRENT_USER.Software.Applied Informatics.Test", keys);
assert (keys.size() == 3);
assert (std::find(keys.begin(), keys.end(), "name1") != keys.end());
assert (std::find(keys.begin(), keys.end(), "name2") != keys.end());
assert (std::find(keys.begin(), keys.end(), "config") != keys.end());
}