- SF#3560505: NetworkInterface's ::forIndex, etc. methods must select all

- Util::Win x64 ifdefs
- RowFromatter documentation correction
This commit is contained in:
Aleksandar Fabijanic 2012-08-22 01:18:33 +00:00
Родитель 71a055c81a
Коммит a77bfefd69
5 изменённых файлов: 19 добавлений и 7 удалений

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

@ -1,10 +1,10 @@
//
// RecordSet.cpp
// RowFormatter.cpp
//
// $Id: //poco/Main/Data/samples/RecordSet/src/RowFormatter.cpp#2 $
//
// This sample demonstrates the Data library recordset formatting
// capabilities.
// This sample demonstrates the Data library recordset row formatting
// and streaming capabilities.
//
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
// and Contributors.

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

@ -748,7 +748,7 @@ bool NetworkInterface::isUp() const
NetworkInterface NetworkInterface::forName(const std::string& name, bool requireIPv6)
{
Map map = NetworkInterface::map();
Map map = NetworkInterface::map(false, false);
Map::const_iterator it = map.begin();
Map::const_iterator end = map.end();
@ -763,7 +763,7 @@ NetworkInterface NetworkInterface::forName(const std::string& name, bool require
NetworkInterface NetworkInterface::forName(const std::string& name, IPVersion ipVersion)
{
Map map = NetworkInterface::map();
Map map = NetworkInterface::map(false, false);
Map::const_iterator it = map.begin();
Map::const_iterator end = map.end();
@ -785,7 +785,7 @@ NetworkInterface NetworkInterface::forName(const std::string& name, IPVersion ip
NetworkInterface NetworkInterface::forAddress(const IPAddress& addr)
{
Map map = NetworkInterface::map();
Map map = NetworkInterface::map(true, false);
Map::const_iterator it = map.begin();
Map::const_iterator end = map.end();
@ -806,7 +806,7 @@ NetworkInterface NetworkInterface::forIndex(unsigned i)
{
if (i != NetworkInterface::NO_INDEX)
{
Map map = NetworkInterface::map();
Map map = NetworkInterface::map(false, false);
Map::const_iterator it = map.find(i);
if (it != map.end())
return it->second;

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

@ -85,9 +85,11 @@ bool WinRegistryConfiguration::getRaw(const std::string& key, std::string& value
case WinRegistryKey::REGT_DWORD:
value = Poco::NumberFormatter::format(aKey.getInt(keyName));
break;
#if defined(POCO_HAVE_INT64)
case WinRegistryKey::REGT_QWORD:
value = Poco::NumberFormatter::format(aKey.getInt64(keyName));
break;
#endif
default:
exists = false;
}

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

@ -250,8 +250,10 @@ void AbstractConfigurationTest::testSetInt()
pConf->setInt("set.int1", 42);
pConf->setInt("set.int2", -100);
pConf->setInt("set.uint", 42U);
assert (pConf->getInt("set.int1") == 42);
assert (pConf->getInt("set.int2") == -100);
assert (pConf->getInt("set.uint") == 42U);
}
@ -422,9 +424,15 @@ Poco::AutoPtr<AbstractConfiguration> AbstractConfigurationTest::createConfigurat
pConfig->setString("prop4.int1", "42");
pConfig->setString("prop4.int2", "-42");
pConfig->setString("prop4.uint", NumberFormatter::format(std::numeric_limits<unsigned>::max()));
#if defined(POCO_HAVE_INT64)
pConfig->setString("prop4.bigint1", NumberFormatter::format(std::numeric_limits<Int64>::max()));
pConfig->setString("prop4.bigint2", NumberFormatter::format(std::numeric_limits<Int64>::min()));
pConfig->setString("prop4.biguint", NumberFormatter::format(std::numeric_limits<UInt64>::max()));
#else /// just to make sure property count is consistent
pConfig->setString("prop4.bigint1", 0));
pConfig->setString("prop4.bigint2", 0));
pConfig->setString("prop4.biguint", 0));
#endif
pConfig->setString("prop4.hex", "0x1f");
pConfig->setString("prop4.double1", "1");
pConfig->setString("prop4.double2", "-1.5");

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

@ -74,10 +74,12 @@ void WinConfigurationTest::testConfiguration()
assert (pReg->getInt("name1") == 1);
pReg->setString("name2", "value2");
assert (pReg->getString("name2") == "value2");
#if defined(POCO_HAVE_INT64)
pReg->setUInt64("name2", std::numeric_limits<UInt64>::max()); // overwrite should also change type
assert (pReg->getUInt64("name2") == std::numeric_limits<UInt64>::max());
pReg->setInt64("name2", std::numeric_limits<Int64>::min());
assert (pReg->getInt64("name2") == std::numeric_limits<Int64>::min());
#endif
assert (pReg->hasProperty("name1"));
assert (pReg->hasProperty("name2"));