Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
dad61d03
Commit
dad61d03
authored
Mar 25, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Don't allow const char * in 2nd argument of strieq_l(S[N], T)
parent
1bbb241b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
src/util.h
src/util.h
+3
-8
src/util_test.cc
src/util_test.cc
+5
-5
No files found.
src/util.h
View file @
dad61d03
...
...
@@ -296,14 +296,9 @@ bool strieq_l(const CharT(&a)[N], InputIt b, size_t blen) {
return
strieq
(
a
,
a
+
(
N
-
1
),
b
,
b
+
blen
);
}
template
<
typename
CharT
,
size_t
N
>
bool
strieq_l
(
const
CharT
(
&
a
)[
N
],
const
std
::
string
&
b
)
{
return
strieq
(
a
,
a
+
(
N
-
1
),
std
::
begin
(
b
),
std
::
end
(
b
));
}
template
<
typename
CharT
,
size_t
N
>
bool
strieq_l
(
const
CharT
(
&
a
)[
N
],
const
StringRef
&
b
)
{
return
strieq
(
a
,
a
+
(
N
-
1
),
std
::
begin
(
b
),
std
::
end
(
b
));
template
<
typename
CharT
,
size_t
N
,
typename
T
>
bool
strieq_l
(
const
CharT
(
&
a
)[
N
],
const
T
&
b
)
{
return
strieq
(
a
,
a
+
(
N
-
1
),
b
.
begin
(),
b
.
end
());
}
template
<
typename
InputIt1
,
typename
InputIt2
>
...
...
src/util_test.cc
View file @
dad61d03
...
...
@@ -91,11 +91,11 @@ void test_util_strieq(void) {
CU_ASSERT
(
!
util
::
strieq_l
(
"alpha"
,
"AlPhA "
,
6
));
CU_ASSERT
(
!
util
::
strieq_l
(
""
,
"AlPhA "
,
6
));
CU_ASSERT
(
util
::
strieq_l
(
"alpha"
,
"alpha"
));
CU_ASSERT
(
util
::
strieq_l
(
"alpha"
,
"AlPhA"
));
CU_ASSERT
(
util
::
strieq_l
(
""
,
""
));
CU_ASSERT
(
!
util
::
strieq_l
(
"alpha"
,
"AlPhA "
));
CU_ASSERT
(
!
util
::
strieq_l
(
""
,
"AlPhA "
));
CU_ASSERT
(
util
::
strieq_l
(
"alpha"
,
StringRef
::
from_lit
(
"alpha"
)
));
CU_ASSERT
(
util
::
strieq_l
(
"alpha"
,
StringRef
::
from_lit
(
"AlPhA"
)
));
CU_ASSERT
(
util
::
strieq_l
(
""
,
StringRef
{}
));
CU_ASSERT
(
!
util
::
strieq_l
(
"alpha"
,
StringRef
::
from_lit
(
"AlPhA "
)
));
CU_ASSERT
(
!
util
::
strieq_l
(
""
,
StringRef
::
from_lit
(
"AlPhA "
)
));
}
void
test_util_inp_strlower
(
void
)
{
...
...
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