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
ISC Open Source Projects
Kea
Commits
8aa5e22a
Commit
8aa5e22a
authored
Oct 29, 2012
by
Mukund Sivaraman
Browse files
[2369] Fix test, skipping backwards before doing newline check
parent
29ff6beb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/inputsource.cc
View file @
8aa5e22a
...
...
@@ -55,10 +55,10 @@ InputSource::ungetChar() {
}
else
if
(
buffer_pos_
==
0
)
{
isc_throw
(
OutOfRange
,
"Cannot skip before the start of buffer"
);
}
else
{
buffer_pos_
--
;
if
(
buffer_
[
buffer_pos_
]
==
'\n'
)
{
line_
--
;
}
buffer_pos_
--
;
}
}
...
...
src/lib/dns/tests/inputsource_unittest.cc
View file @
8aa5e22a
...
...
@@ -132,8 +132,10 @@ TEST_F(InputSourceTest, lines) {
EXPECT_TRUE
(
source_
.
atEOF
());
EXPECT_EQ
(
4
,
source_
.
getCurrentLine
());
// Go backwards
1
character, skipping the last '\n'.
// Go backwards
2
character
s
, skipping the last
EOF and
'\n'.
source_
.
ungetChar
();
source_
.
ungetChar
();
EXPECT_FALSE
(
source_
.
atEOF
());
EXPECT_EQ
(
3
,
source_
.
getCurrentLine
());
...
...
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