}
}
-};
+} // namespace
namespace isc {
namespace dhcp {
++extract_count;
}
-};
-};
-};
+} // namespace test
+} // namespace dhcp
+} // namespace isc
namespace {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
-/// Define the parameterized test loop
-INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
- ::testing::Range(static_cast<size_t>(0), max_config_counter));
-
+class IntToString {
+public:
+ std::string operator()(const testing::TestParamInfo<size_t>& n) {
+ return to_string(n.param);
+ }
};
+
+/// Define the parameterized test loop.
+INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
+ ::testing::Range(static_cast<size_t>(0),
+ max_config_counter),
+ IntToString());
+} // namespace
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
-/// Define the parameterized test loop
-INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
- ::testing::Range(static_cast<size_t>(0), max_config_counter));
-
+class IntToString {
+public:
+ std::string operator()(const testing::TestParamInfo<size_t>& n) {
+ return to_string(n.param);
+ }
};
+
+/// Define the parameterized test loop.
+INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
+ ::testing::Range(static_cast<size_t>(0),
+ max_config_counter),
+ IntToString());
+} // namespace
" {\n"
" \"always-send\": false,\n"
" \"code\": 7,\n"
-" \"csv-format\": false,\n"
+" \"csv-format\": true,\n"
" \"data\": \"01\",\n"
" \"name\": \"preference\",\n"
" \"space\": \"dhcp6\"\n"
}
}
-};
+}
namespace isc {
namespace dhcp {
++extract_count;
}
-};
-};
-};
+} // namespace test
+} // namespace dhcp
+} // namespace isc
namespace {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
-/// Define the parameterized test loop
-INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
- ::testing::Range(static_cast<size_t>(0), max_config_counter));
-
+class IntToString {
+public:
+ std::string operator()(const testing::TestParamInfo<size_t>& n) {
+ return to_string(n.param);
+ }
};
+
+/// Define the parameterized test loop.
+INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
+ ::testing::Range(static_cast<size_t>(0),
+ max_config_counter),
+ IntToString());
+} // namespace
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
-/// Define the parameterized test loop
-INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
- ::testing::Range(static_cast<size_t>(0), max_config_counter));
-
+class IntToString {
+public:
+ std::string operator()(const testing::TestParamInfo<size_t>& n) {
+ return to_string(n.param);
+ }
};
+
+/// Define the parameterized test loop.
+INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
+ ::testing::Range(static_cast<size_t>(0),
+ max_config_counter),
+ IntToString());
+} // namespace
}
ElementPtr
-Element::fromJSON(std::istream& in, bool preproc) throw(JSONError) {
+Element::fromJSON(std::istream& in, bool preproc) {
int line = 1, pos = 1;
stringstream filtered;
ElementPtr
Element::fromJSON(std::istream& in, const std::string& file_name, bool preproc)
- throw(JSONError)
{
int line = 1, pos = 1;
stringstream filtered;
ElementPtr
Element::fromJSON(std::istream& in, const std::string& file, int& line,
- int& pos) throw(JSONError)
+ int& pos)
{
int c = 0;
ElementPtr element;
// open the list
out << "[" << (complex ? "\n" : " ");
-
+
// iterate on items
typedef std::vector<ElementPtr> ListType;
const ListType& l = element->listValue();
/// should be performed
/// @return An ElementPtr that contains the element(s) specified
/// in the given input stream.
- static ElementPtr fromJSON(std::istream& in, bool preproc = false)
- throw(JSONError);
+ static ElementPtr fromJSON(std::istream& in, bool preproc = false);
/// Creates an Element from the given input stream containing JSON
/// formatted data.
/// @return An ElementPtr that contains the element(s) specified
/// in the given input stream.
static ElementPtr fromJSON(std::istream& in, const std::string& file_name,
- bool preproc = false)
- throw(JSONError);
+ bool preproc = false);
/// Creates an Element from the given input stream, where we keep
/// track of the location in the stream for error reporting.
/// in the given input stream.
// make this one private?
static ElementPtr fromJSON(std::istream& in, const std::string& file,
- int& line, int &pos)
- throw(JSONError);
+ int& line, int &pos);
/// Reads contents of specified file and interprets it as JSON.
///
/// negative means outbound and perhaps looping forever).
/// @return a pointer to a fresh copy
/// \throw raises a BadValue is a null pointer occurs.
-ElementPtr copy(ConstElementPtr from, int level = 100);
+ElementPtr copy(ConstElementPtr from, int level = 100);
/// @brief Compares the data with other using unordered lists
///
ModuleSpec::ModuleSpec(ConstElementPtr module_spec_element,
const bool check)
- throw(ModuleSpecError)
-
+
{
module_specification = module_spec_element;
if (check) {
ModuleSpec
moduleSpecFromFile(const std::string& file_name, const bool check)
- throw(JSONError, ModuleSpecError)
{
std::ifstream file;
ModuleSpec
moduleSpecFromFile(std::ifstream& in, const bool check)
- throw(JSONError, ModuleSpecError)
{
ConstElementPtr module_spec_element = Element::fromJSON(in);
if (module_spec_element->contains("module_spec")) {
bool optional = spec->get("item_optional")->boolValue();
ConstElementPtr data_el;
data_el = data->get(item_name);
-
+
if (data_el) {
if (!validateItem(spec, data_el, full, errors)) {
return (false);
}
typedef std::pair<std::string, ConstElementPtr> maptype;
-
+
BOOST_FOREACH(maptype m, data->mapValue()) {
// Ignore 'version' as a config element
if (m.first.compare("version") != 0) {
/// \param check If false, the module specification in the file
/// is not checked to be of the correct form.
explicit ModuleSpec(isc::data::ConstElementPtr e,
- const bool check = true)
- throw(ModuleSpecError);
+ const bool check = true);
/// Returns the commands part of the specification as an
/// ElementPtr, returns an empty ElementPtr if there is none
/// Returns the module name as specified by the specification
const std::string getModuleName() const;
-
+
/// Returns the module description as specified by the specification
/// returns an empty string if there is no description
const std::string getModuleDescription() const;
-
+
// returns true if the given element conforms to this data
// configuration specification
/// Validates the given configuration data for this specification.
/// \param check If true, the module specification in the file
/// is checked to be of the correct form
ModuleSpec
- moduleSpecFromFile(const std::string& file_name, const bool check = true)
- throw(isc::data::JSONError, ModuleSpecError);
+ moduleSpecFromFile(const std::string& file_name, const bool check = true);
/// Creates a \c ModuleSpec instance from the given input
/// stream that contains the contents of a .spec file.
/// \param check If true, the module specification is checked
/// to be of the correct form
ModuleSpec
- moduleSpecFromFile(std::ifstream& in, const bool check = true)
- throw(isc::data::JSONError, ModuleSpecError);
+ moduleSpecFromFile(std::ifstream& in, const bool check = true);
} }
#endif // _DATA_DEF_H
-// Local Variables:
+// Local Variables:
// mode: c++
-// End:
+// End:
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#include <config.h>
+
#include <dhcp/libdhcp++.h>
-#include <dhcp/option_space.h>
#include <dhcpsrv/cfg_option.h>
#include <dhcp/dhcp6.h>
+#include <dhcp/option_space.h>
#include <util/encode/hex.h>
#include <string>
#include <sstream>
// If there is no such option in the destination container,
// add one.
if (std::distance(range.first, range.second) == 0) {
- dest_container.addItem(OptionDescriptor(src_opt->option_,
- src_opt->persistent_),
- *it);
+ dest_container.addItem(OptionDescriptor(
+ src_opt->option_, src_opt->persistent_,
+ src_opt->formatted_value_), *it);
}
}
}
return (result);
}
-} // end of namespace isc::dhcp
-} // end of namespace isc
+} // namespace dhcp
+} // namespace isc
#include <dhcpsrv/db_exceptions.h>
#include <dhcpsrv/mysql_connection.h>
+#include <stdint.h>
+
+#include <utility>
+#include <string>
+
namespace isc {
namespace dhcp {
///
/// This method supports v4 hosts only.
///
- /// @param subnet_id subnet identifier.
- /// @param addr specified address.
- /// @return true if deletion was successful, false if the host was not there.
+ /// @param subnet_id subnet identfier
+ /// @param identifier_type type of host identifier (e.g. DUID, hardware
+ /// address)
+ /// @param identifier_begin pointer to the beginning of a buffer containing
+ /// an identifier
+ /// @param identifier_len host identifier length
+ /// @return true if deletion was successful, false if the host was not there
/// @throw various exceptions in case of errors
virtual bool del4(const SubnetID& subnet_id,
const Host::IdentifierType& identifier_type,
///
/// This method supports v6 hosts only.
///
- /// @param subnet_id subnet identifier.
- /// @param addr specified address.
- /// @return true if deletion was successful, false if the host was not there.
+ /// @param subnet_id subnet identfier
+ /// @param identifier_type type of host identifier (e.g. DUID, hardware
+ /// address)
+ /// @param identifier_begin pointer to the beginning of a buffer containing
+ /// an identifier
+ /// @param identifier_len host identifier length
+ /// @return true if deletion was successful, false if the host was not there
/// @throw various exceptions in case of errors
virtual bool del6(const SubnetID& subnet_id,
const Host::IdentifierType& identifier_type,
virtual void rollback();
private:
-
/// @brief Pointer to the implementation of the @ref MySqlHostDataSource.
MySqlHostDataSourceImpl* impl_;
};
}
#endif // MYSQL_HOST_DATA_SOURCE_H
+
condvar->wait(*mutex);
}
-TEST_F(CondVarTest,
#ifdef HAS_UNDEFINED_PTHREAD_BEHAVIOR
- DISABLED_destroyWhileWait
+TEST_F(CondVarTest, DISABLED_destroyWhileWait) {
#else
- destroyWhileWait
+TEST_F(CondVarTest, destroyWhileWait) {
#endif
-) {
// We'll destroy a CondVar object while the thread is still waiting
// on it. This will trigger an assertion failure.
if (!isc::util::unittests::runningOnValgrind()) {
#endif // ENABLE_DEBUG
// Destroying a locked mutex is a bad idea as well
-TEST(MutexTest,
#ifdef HAS_UNDEFINED_PTHREAD_BEHAVIOR
- DISABLED_destroyLocked
+TEST(MutexTest, DISABLED_destroyLocked) {
#else
- destroyLocked
+TEST(MutexTest, destroyLocked) {
#endif
-) {
if (!isc::util::unittests::runningOnValgrind()) {
EXPECT_DEATH_IF_SUPPORTED({
Mutex* mutex = new Mutex;