-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
S_Val s_type(new Val("memfile"));
EXPECT_NO_THROW(sess_->set_item(xtype.c_str(), s_type));
uint32_t li = 3600;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_interval(new Val(li));
+#else
S_Val s_interval(new Val(li, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xinterval.c_str(), s_interval));
// Get empty.
S_Val s_type(new Val("memfile"));
EXPECT_NO_THROW(sess_->set_item(xtype.c_str(), s_type));
uint32_t li = 3600;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_interval(new Val(li));
+#else
S_Val s_interval(new Val(li, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xinterval.c_str(), s_interval));
// Reset to empty.
S_Val s_host(new Val("localhost"));
EXPECT_NO_THROW(sess_->set_item(xhost.c_str(), s_host));
uint16_t mport = 3306;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_port(new Val(mport));
+#else
S_Val s_port(new Val(mport, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xport.c_str(), s_port));
// Get empty.
S_Val s_host(new Val("localhost"));
EXPECT_NO_THROW(sess_->set_item(xhost.c_str(), s_host));
uint16_t mport = 3306;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_port(new Val(mport));
+#else
S_Val s_port(new Val(mport, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xport.c_str(), s_port));
// Reset to empty.
S_Val s_host(new Val("localhost"));
EXPECT_NO_THROW(sess_->set_item(xhost.c_str(), s_host));
uint16_t mport = 3306;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_port(new Val(mport));
+#else
S_Val s_port(new Val(mport, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xport.c_str(), s_port));
// Reset to empty.
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
S_Val s_severity(new Val("WARN", SR_ENUM_T));
EXPECT_NO_THROW(sess_->set_item(xseverity.c_str(), s_severity));
uint32_t max_ver = 10;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_maxver(new Val(max_ver));
+#else
S_Val s_maxver(new Val(max_ver, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(xmaxver.c_str(), s_maxver));
// Get empty.
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
EXPECT_NO_THROW(sess_->set_item(prefix.c_str(), s_prefix));
const string& length = xpath + "/prefix-length";
uint8_t len = 56;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_length(new Val(len));
+#else
S_Val s_length(new Val(len, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(length.c_str(), s_length));
// Get the pool.
spool << xpath + "/pd-pool[prefix='" << prefix << "']";
const string& x_delegated = spool.str() + "/delegated-len";
uint8_t dl = 64;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_delegated(new Val(dl));
+#else
S_Val s_delegated(new Val(dl, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(x_delegated.c_str(), s_delegated));
// Get the pool.
spool << xpath + "/pd-pool[prefix='" << prefix << "']";
const string& x_delegated = spool.str() + "/delegated-len";
uint8_t dl = 64;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_delegated(new Val(dl));
+#else
S_Val s_delegated(new Val(dl, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(x_delegated.c_str(), s_delegated));
// Create the second pd-pool 2001:db8:0:2000::/56
spool2 << xpath + "/pd-pool[prefix='" << prefix2 << "']";
const string& x_delegated2 = spool2.str() + "/delegated-len";
uint8_t dl2 = 60;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ S_Val s_delegated2(new Val(dl2));
+#else
S_Val s_delegated2(new Val(dl2, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess_->set_item(x_delegated2.c_str(), s_delegated2));
// Unsigned 8 bit integer.
uint8_t u8(123);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Unsigned 16 bit integer.
uint16_t u16(12345);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u16));
+#else
s_val.reset(new Val(u16, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Unsigned 32 bit integer.
uint32_t u32(123456789);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u32));
+#else
s_val.reset(new Val(u32, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Signed 8 bit integer.
int8_t s8(-123);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s8));
+#else
s_val.reset(new Val(s8, SR_INT8_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Signed 16 bit integer.
int16_t s16(-12345);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s16));
+#else
s_val.reset(new Val(s16, SR_INT16_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Signed 32 bit integer.
int32_t s32(-123456789);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s32));
+#else
s_val.reset(new Val(s32, SR_INT32_T));
+#endif
EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
ASSERT_TRUE(elem);
ASSERT_EQ(Element::integer, elem->getType());
// Unsigned 8 bit integer.
xpath = "/keatest-module:main/ui8";
uint8_t u8(8);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Unsigned 16 bit integer.
xpath = "/keatest-module:main/ui16";
uint16_t u16(16);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u16));
+#else
s_val.reset(new Val(u16, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Unsigned 32 bit integer.
xpath = "/keatest-module:main/ui32";
uint32_t u32(32);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u32));
+#else
s_val.reset(new Val(u32, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Signed 8 bit integer.
xpath = "/keatest-module:main/i8";
int8_t s8(8);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s8));
+#else
s_val.reset(new Val(s8, SR_INT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Signed 16 bit integer.
xpath = "/keatest-module:main/i16";
int16_t s16(16);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s16));
+#else
s_val.reset(new Val(s16, SR_INT16_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Signed 32 bit integer.
xpath = "/keatest-module:main/i32";
int32_t s32(32);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s32));
+#else
s_val.reset(new Val(s32, SR_INT32_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
ASSERT_TRUE(elem);
// Leaf-list: 1, 2 and 3.
u8 = 1;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
u8 = 2;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
u8 = 3;
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
EXPECT_NO_THROW(elem = t_obj->getItems(xpath));
ASSERT_TRUE(elem);
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
xpath = "/keatest-module:main/ui8";
uint8_t u8(8);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/ui16";
uint16_t u16(16);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u16));
+#else
s_val.reset(new Val(u16, SR_UINT16_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/ui32";
uint32_t u32(32);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u32));
+#else
s_val.reset(new Val(u32, SR_UINT32_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/i8";
int8_t s8(8);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s8));
+#else
s_val.reset(new Val(s8, SR_INT8_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/i16";
int16_t s16(16);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s16));
+#else
s_val.reset(new Val(s16, SR_INT16_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/i32";
int32_t s32(32);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(s32));
+#else
s_val.reset(new Val(s32, SR_INT32_T));
+#endif
EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
xpath = "/keatest-module:main/id_ref";
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
case SR_UINT8_T:
try {
uint8_t u8 = boost::lexical_cast<unsigned>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u8));
+#else
s_val.reset(new Val(u8, SR_UINT8_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an uint8");
case SR_UINT16_T:
try {
uint16_t u16 = boost::lexical_cast<uint16_t>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u16));
+#else
s_val.reset(new Val(u16, SR_UINT16_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an uint16");
case SR_UINT32_T:
try {
uint32_t u32 = boost::lexical_cast<uint32_t>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(u32));
+#else
s_val.reset(new Val(u32, SR_UINT32_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an uint32");
case SR_INT8_T:
try {
int8_t i8 = boost::lexical_cast<int>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(i8));
+#else
s_val.reset(new Val(i8, SR_INT8_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an int8");
case SR_INT16_T:
try {
int16_t i16 = boost::lexical_cast<int16_t>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(i16));
+#else
s_val.reset(new Val(i16, SR_INT16_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an int16");
case SR_INT32_T:
try {
int32_t i32 = boost::lexical_cast<int32_t>(item.value_);
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(i32));
+#else
s_val.reset(new Val(i32, SR_INT32_T));
+#endif
} catch (const boost::bad_lexical_cast&) {
isc_throw(BadValue,
"'" << item.value_ << "' not an int32");
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<uint8_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<uint8_t>(elem->intValue()), type));
+#endif
break;
case SR_UINT16_T:
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<uint16_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<uint16_t>(elem->intValue()), type));
+#endif
break;
case SR_UINT32_T:
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<uint32_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<uint32_t>(elem->intValue()), type));
+#endif
break;
case SR_INT8_T:
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<int8_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<int8_t>(elem->intValue()), type));
+#endif
break;
case SR_INT16_T:
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<int16_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<int16_t>(elem->intValue()), type));
+#endif
break;
case SR_INT32_T:
"value for an integer called with not an integer: "
<< elem->str());
}
+#ifdef HAVE_POST_0_7_7_SYSREPO
+ s_val.reset(new Val(static_cast<int32_t>(elem->intValue())));
+#else
s_val.reset(new Val(static_cast<int32_t>(elem->intValue()), type));
+#endif
break;
case SR_BINARY_T: