Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
9cccfbbc
Commit
9cccfbbc
authored
Jul 23, 2013
by
Michal 'vorner' Vaner
Browse files
[2862] Signal if segment was reset by result
parent
f1c0d707
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/client_list.cc
View file @
9cccfbbc
...
...
@@ -330,7 +330,7 @@ ConfigurableClientList::findInternal(MutableResult& candidate,
// and the need_updater parameter is true, get the zone there.
}
void
bool
ConfigurableClientList
::
resetMemorySegment
(
const
std
::
string
&
datasrc_name
,
ZoneTableSegment
::
MemorySegmentOpenMode
mode
,
...
...
@@ -340,9 +340,10 @@ ConfigurableClientList::resetMemorySegment
if
(
info
.
name_
==
datasrc_name
)
{
ZoneTableSegment
&
segment
=
*
info
.
ztable_segment_
;
segment
.
reset
(
mode
,
config_params
);
b
re
ak
;
re
turn
true
;
}
}
return
false
;
}
ConfigurableClientList
::
ZoneWriterPair
...
...
src/lib/datasrc/client_list.h
View file @
9cccfbbc
...
...
@@ -385,7 +385,8 @@ public:
/// \param datasrc_name The name of the data source whose segment to reset
/// \param mode The open mode for the new memory segment
/// \param config_params The configuration for the new memory segment.
void
resetMemorySegment
/// \return If the data source was found and reset.
bool
resetMemorySegment
(
const
std
::
string
&
datasrc_name
,
memory
::
ZoneTableSegment
::
MemorySegmentOpenMode
mode
,
isc
::
data
::
ConstElementPtr
config_params
);
...
...
src/lib/datasrc/tests/client_list_unittest.cc
View file @
9cccfbbc
...
...
@@ -368,7 +368,8 @@ public:
const
std
::
string
&
datasrc_name
,
ZoneTableSegment
::
MemorySegmentOpenMode
mode
,
ConstElementPtr
config_params
)
{
list
.
resetMemorySegment
(
datasrc_name
,
mode
,
config_params
);
EXPECT_TRUE
(
list
.
resetMemorySegment
(
datasrc_name
,
mode
,
config_params
));
}
virtual
std
::
string
getType
()
{
return
(
"mapped"
);
...
...
@@ -383,6 +384,13 @@ INSTANTIATE_TEST_CASE_P(ListTestMapped, ListTest,
#endif
// Calling reset on empty list finds no data and returns false.
TEST_P
(
ListTest
,
emptyReset
)
{
EXPECT_FALSE
(
list_
->
resetMemorySegment
(
"Something"
,
memory
::
ZoneTableSegment
::
CREATE
,
Element
::
create
()));
}
// Test the test itself
TEST_P
(
ListTest
,
selfTest
)
{
EXPECT_EQ
(
result
::
SUCCESS
,
ds_
[
0
]
->
findZone
(
Name
(
"example.org"
)).
code
);
...
...
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