Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
92b4df9e
Commit
92b4df9e
authored
Nov 20, 2015
by
Francis Dupont
Browse files
[4097a] Added a ClientClasses iteration unit test
parent
336a2215
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/tests/classify_unittest.cc
View file @
92b4df9e
// Copyright (C) 2011-201
4
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-201
5
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -85,3 +85,33 @@ TEST(ClassifyTest, ClientClassesFromString) {
EXPECT_TRUE
(
classes
.
empty
());
}
}
// Check if one can iterate over a ClientClasses object
TEST
(
ClassifyTest
,
ClientClassesIterator
)
{
ClientClasses
classes
(
"alpha, beta, gamma"
);
size_t
count
=
0
;
bool
seenalpha
=
false
;
bool
seenbeta
=
false
;
bool
seengamma
=
false
;
bool
seendelta
=
false
;
for
(
ClientClasses
::
const_iterator
it
=
classes
.
begin
();
it
!=
classes
.
end
();
++
it
)
{
++
count
;
if
(
*
it
==
"alpha"
)
{
seenalpha
=
true
;
}
else
if
(
*
it
==
"beta"
)
{
seenbeta
=
true
;
}
else
if
(
*
it
==
"gamma"
)
{
seengamma
=
true
;
}
else
if
(
*
it
==
"delta"
)
{
seendelta
=
true
;
}
else
{
ADD_FAILURE
()
<<
"Got unexpected "
<<
*
it
;
}
}
EXPECT_EQ
(
count
,
classes
.
size
());
EXPECT_TRUE
(
seenalpha
);
EXPECT_TRUE
(
seenbeta
);
EXPECT_TRUE
(
seengamma
);
EXPECT_FALSE
(
seendelta
);
}
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