Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Pavel Zhukov
Kea
Commits
89dad52a
Commit
89dad52a
authored
Oct 23, 2018
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[65-libyang-testutils] Cosmetics (trailing dots) and a '>>'
parent
7de62601
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
27 deletions
+24
-27
src/lib/yang/tests/adaptor_config_unittests.cc
src/lib/yang/tests/adaptor_config_unittests.cc
+2
-2
src/lib/yang/tests/translator_utils_unittests.cc
src/lib/yang/tests/translator_utils_unittests.cc
+4
-6
src/lib/yang/tests/yang_configs.h
src/lib/yang/tests/yang_configs.h
+10
-11
src/lib/yang/testutils/translator_test.h
src/lib/yang/testutils/translator_test.h
+8
-8
No files found.
src/lib/yang/tests/adaptor_config_unittests.cc
View file @
89dad52a
...
...
@@ -82,7 +82,7 @@ TEST_F(AdaptorConfigTest, loadExamples4) {
"with-ddns.json"
};
ElementPtr
x
;
for
(
int
i
=
0
;
i
<
configs
.
size
();
i
++
)
{
x
.
reset
();
testFile
(
string
(
CFG_EXAMPLES
)
+
"/kea4/"
+
configs
[
i
],
false
,
x
);
...
...
@@ -113,7 +113,7 @@ TEST_F(AdaptorConfigTest, loadExamples6) {
"stateless.json"
,
"with-ddns.json"
};
ElementPtr
x
;
for
(
int
i
=
0
;
i
<
configs
.
size
();
i
++
)
{
x
.
reset
();
testFile
(
string
(
CFG_EXAMPLES
)
+
"/kea6/"
+
configs
[
i
],
true
,
x
);
...
...
src/lib/yang/tests/translator_utils_unittests.cc
View file @
89dad52a
...
...
@@ -202,13 +202,12 @@ TEST(YangReprTest, setTest) {
EXPECT_TRUE
(
repr
.
verify
(
testTree
,
sess
,
cerr
));
}
/// @brief Tests specified configuration.
///
/// Configuration is set and then verified using YangRepr object.
///
/// @param model name of the model to be verified against
/// @param tree tree to be verified
/// @param model name of the model to be verified against
.
/// @param tree tree to be verified
.
void
sanityCheckConfig
(
const
std
::
string
&
model
,
const
YRTree
&
tree
)
{
// Get a translator object to play with.
S_Connection
conn
(
new
Connection
(
"utils unittests"
));
...
...
@@ -225,8 +224,8 @@ void sanityCheckConfig(const std::string& model, const YRTree& tree) {
EXPECT_TRUE
(
result
);
}
// This is test environment sanity check. It verifies that
every
configuration
// defined in yang_configs.h
is
sane.
// This is test environment sanity check. It verifies that
all
configuration
// defined in yang_configs.h
are
sane.
TEST
(
YangReprTest
,
verifyConfigs
)
{
for
(
auto
x
:
test_configs
)
{
cout
<<
"Testing tree for model "
<<
x
.
first
<<
endl
;
...
...
@@ -234,5 +233,4 @@ TEST(YangReprTest, verifyConfigs) {
}
}
};
// end of anonymous namespace
src/lib/yang/tests/yang_configs.h
View file @
89dad52a
...
...
@@ -442,20 +442,19 @@ const YRTree designExampleTree = {
"disabled"
,
SR_ENUM_T
,
true
}
};
/// @brief Set of example configurations
const
std
::
vector
<
std
::
pair
<
std
::
string
,
YRTree
>>
test_configs
=
/// @brief Set of example configurations
.
const
std
::
vector
<
std
::
pair
<
std
::
string
,
YRTree
>
>
test_configs
=
{
{
exampleModel
,
exampleTree
},
{
testModel
,
testTree
},
{
subnetTwoPoolsModelIetf6
,
subnetTwoPoolsTreeIetf6
},
{
subnetTimersModel
,
subnetTimersIetf6
},
{
validModelIetf6
,
validTreeIetf6
},
{
subnetOptionsModelKeaDhcp4
,
subnetOptionsTreeKeaDhcp4
},
{
subnetOptionsModelKeaDhcp6
,
subnetOptionsTreeKeaDhcp6
},
{
designExampleModel
,
designExampleTree
}
{
exampleModel
,
exampleTree
},
{
testModel
,
testTree
},
{
subnetTwoPoolsModelIetf6
,
subnetTwoPoolsTreeIetf6
},
{
subnetTimersModel
,
subnetTimersIetf6
},
{
validModelIetf6
,
validTreeIetf6
},
{
subnetOptionsModelKeaDhcp4
,
subnetOptionsTreeKeaDhcp4
},
{
subnetOptionsModelKeaDhcp6
,
subnetOptionsTreeKeaDhcp6
},
{
designExampleModel
,
designExampleTree
}
};
};
// end of namespace isc::yang::test
};
// end of namespace isc::yang
};
// end of namespace isc
...
...
src/lib/yang/testutils/translator_test.h
View file @
89dad52a
...
...
@@ -41,11 +41,11 @@ public:
:
xpath_
(
xpath
),
value_
(
value
),
type_
(
type
),
settable_
(
settable
)
{
}
/// @brief Retrieves configuration parameter from sysrepo
/// @brief Retrieves configuration parameter from sysrepo
.
///
/// @param xpath The xpath of an element to be retrieved
/// @param xpath The xpath of an element to be retrieved
.
/// @param session Sysrepo session.
/// @return YangReprItem instance representing configuration parameter
/// @return YangReprItem instance representing configuration parameter
.
static
YangReprItem
get
(
const
std
::
string
&
xpath
,
S_Session
session
);
/// @brief The xpath.
...
...
@@ -62,8 +62,8 @@ public:
/// @brief The equal operator ignoring settable.
///
/// @param other the other object to compare with
/// @return true if equal
/// @param other the other object to compare with
.
/// @return true if equal
.
bool
operator
==
(
const
YangReprItem
&
other
)
const
{
return
((
xpath_
==
other
.
xpath_
)
&&
(
value_
==
other
.
value_
)
&&
...
...
@@ -72,8 +72,8 @@ public:
/// @brief The unequal operator ignoring settable.
///
/// @param other the other object to compare with
/// @return false if equal
/// @param other the other object to compare with
.
/// @return false if equal
.
bool
operator
!=
(
const
YangReprItem
&
other
)
const
{
return
(
!
(
*
this
==
other
));
}
...
...
@@ -92,7 +92,7 @@ public:
/// @param expected The expected value.
/// @param session Sysrepo session.
/// @param errs Error stream.
/// @return true if verification succeeds, false with errors displayed
/// @return true if verification succeeds, false with errors displayed
.
/// on errs if it fails.
bool
verify
(
const
Tree
&
expected
,
S_Session
session
,
std
::
ostream
&
errs
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment