From a77bfefd698f09ff2316b7478f2da71d809e164b Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Wed, 22 Aug 2012 01:18:33 +0000 Subject: [PATCH] - SF#3560505: NetworkInterface's ::forIndex, etc. methods must select all - Util::Win x64 ifdefs - RowFromatter documentation correction --- Data/samples/RowFormatter/src/RowFormatter.cpp | 6 +++--- Net/src/NetworkInterface.cpp | 8 ++++---- Util/src/WinRegistryConfiguration.cpp | 2 ++ Util/testsuite/src/AbstractConfigurationTest.cpp | 8 ++++++++ Util/testsuite/src/WinConfigurationTest.cpp | 2 ++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Data/samples/RowFormatter/src/RowFormatter.cpp b/Data/samples/RowFormatter/src/RowFormatter.cpp index 81c05f008..42c0496f9 100644 --- a/Data/samples/RowFormatter/src/RowFormatter.cpp +++ b/Data/samples/RowFormatter/src/RowFormatter.cpp @@ -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. diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index 4abb97b29..f04c73713 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -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; diff --git a/Util/src/WinRegistryConfiguration.cpp b/Util/src/WinRegistryConfiguration.cpp index d3a33827e..0c89ee5bb 100644 --- a/Util/src/WinRegistryConfiguration.cpp +++ b/Util/src/WinRegistryConfiguration.cpp @@ -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; } diff --git a/Util/testsuite/src/AbstractConfigurationTest.cpp b/Util/testsuite/src/AbstractConfigurationTest.cpp index bc16f1802..321eeacdb 100644 --- a/Util/testsuite/src/AbstractConfigurationTest.cpp +++ b/Util/testsuite/src/AbstractConfigurationTest.cpp @@ -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 AbstractConfigurationTest::createConfigurat pConfig->setString("prop4.int1", "42"); pConfig->setString("prop4.int2", "-42"); pConfig->setString("prop4.uint", NumberFormatter::format(std::numeric_limits::max())); +#if defined(POCO_HAVE_INT64) pConfig->setString("prop4.bigint1", NumberFormatter::format(std::numeric_limits::max())); pConfig->setString("prop4.bigint2", NumberFormatter::format(std::numeric_limits::min())); pConfig->setString("prop4.biguint", NumberFormatter::format(std::numeric_limits::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"); diff --git a/Util/testsuite/src/WinConfigurationTest.cpp b/Util/testsuite/src/WinConfigurationTest.cpp index cc1c0c915..022239cc5 100644 --- a/Util/testsuite/src/WinConfigurationTest.cpp +++ b/Util/testsuite/src/WinConfigurationTest.cpp @@ -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::max()); // overwrite should also change type assert (pReg->getUInt64("name2") == std::numeric_limits::max()); pReg->setInt64("name2", std::numeric_limits::min()); assert (pReg->getInt64("name2") == std::numeric_limits::min()); +#endif assert (pReg->hasProperty("name1")); assert (pReg->hasProperty("name2"));