Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
9cec466e
Commit
9cec466e
authored
Sep 30, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix UT warning on clang
parent
b5900a38
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
10 deletions
+10
-10
brpc_hpack_unittest.cpp
test/brpc_hpack_unittest.cpp
+3
-3
brpc_http_rpc_protocol_unittest.cpp
test/brpc_http_rpc_protocol_unittest.cpp
+1
-1
brpc_load_balancer_unittest.cpp
test/brpc_load_balancer_unittest.cpp
+2
-2
brpc_uri_unittest.cpp
test/brpc_uri_unittest.cpp
+1
-1
iobuf_unittest.cpp
test/iobuf_unittest.cpp
+2
-2
temp_file_unittest.cpp
test/temp_file_unittest.cpp
+1
-1
No files found.
test/brpc_hpack_unittest.cpp
View file @
9cec466e
...
...
@@ -23,7 +23,7 @@ TEST_F(HPackTest, header_with_indexing) {
options
.
index_policy
=
brpc
::
HPACK_INDEX_HEADER
;
butil
::
IOBufAppender
buf
;
p1
.
Encode
(
&
buf
,
h
,
options
);
const
size_t
nwrite
=
buf
.
buf
().
size
();
const
s
s
ize_t
nwrite
=
buf
.
buf
().
size
();
LOG
(
INFO
)
<<
butil
::
ToPrintable
(
buf
.
buf
());
uint8_t
expected
[]
=
{
0x40
,
0x0a
,
0x63
,
0x75
,
0x73
,
0x74
,
0x6f
,
0x6d
,
0x2d
,
0x6b
,
0x65
,
0x79
,
...
...
@@ -53,7 +53,7 @@ TEST_F(HPackTest, header_without_indexing) {
options
.
index_policy
=
brpc
::
HPACK_NOT_INDEX_HEADER
;
butil
::
IOBufAppender
buf
;
p1
.
Encode
(
&
buf
,
h
,
options
);
const
size_t
nwrite
=
buf
.
buf
().
size
();
const
s
s
ize_t
nwrite
=
buf
.
buf
().
size
();
LOG
(
INFO
)
<<
butil
::
ToPrintable
(
buf
.
buf
());
uint8_t
expected
[]
=
{
0x04
,
0x0c
,
0x2f
,
0x73
,
0x61
,
0x6d
,
0x70
,
0x6c
,
0x65
,
0x2f
,
0x70
,
0x61
,
...
...
@@ -83,7 +83,7 @@ TEST_F(HPackTest, header_never_indexed) {
options
.
index_policy
=
brpc
::
HPACK_NEVER_INDEX_HEADER
;
butil
::
IOBufAppender
buf
;
p1
.
Encode
(
&
buf
,
h
,
options
);
const
size_t
nwrite
=
buf
.
buf
().
size
();
const
s
s
ize_t
nwrite
=
buf
.
buf
().
size
();
LOG
(
INFO
)
<<
butil
::
ToPrintable
(
buf
.
buf
());
uint8_t
expected
[]
=
{
0x10
,
0x08
,
0x70
,
0x61
,
0x73
,
0x73
,
0x77
,
0x6f
,
0x72
,
0x64
,
...
...
test/brpc_http_rpc_protocol_unittest.cpp
View file @
9cec466e
...
...
@@ -493,7 +493,7 @@ public:
if
(
_done_place
==
DONE_BEFORE_CREATE_PA
)
{
done_guard
.
reset
(
NULL
);
}
ASSERT_GT
(
PA_DATA_LEN
,
8
);
// long enough to hold a 64-bit decimal.
ASSERT_GT
(
PA_DATA_LEN
,
8
u
);
// long enough to hold a 64-bit decimal.
char
buf
[
PA_DATA_LEN
];
for
(
size_t
c
=
0
;
c
<
_nrep
;)
{
CopyPAPrefixedWithSeqNo
(
buf
,
c
);
...
...
test/brpc_load_balancer_unittest.cpp
View file @
9cec466e
...
...
@@ -596,7 +596,7 @@ TEST_F(LoadBalancerTest, weighted_round_robin) {
// There are 3 valid servers with weight 3, 2 and 7 respectively.
// We run SelectServer for 12 times. The result number of each server seleted should be
// consistent with weight configured.
std
::
map
<
butil
::
EndPoint
,
size_
t
>
select_result
;
std
::
map
<
butil
::
EndPoint
,
in
t
>
select_result
;
brpc
::
SocketUniquePtr
ptr
;
brpc
::
LoadBalancer
::
SelectIn
in
=
{
0
,
false
,
false
,
0u
,
NULL
};
brpc
::
LoadBalancer
::
SelectOut
out
(
&
ptr
);
...
...
@@ -613,7 +613,7 @@ TEST_F(LoadBalancerTest, weighted_round_robin) {
}
std
::
cout
<<
std
::
endl
;
// Check whether slected result is consistent with expected.
EXPECT_EQ
(
3
,
select_result
.
size
());
EXPECT_EQ
(
(
size_t
)
3
,
select_result
.
size
());
for
(
const
auto
&
result
:
select_result
)
{
std
::
cout
<<
result
.
first
<<
" result="
<<
result
.
second
<<
" configured="
<<
configed_weight
[
result
.
first
]
<<
std
::
endl
;
...
...
test/brpc_uri_unittest.cpp
View file @
9cec466e
...
...
@@ -38,7 +38,7 @@ TEST(URITest, only_host) {
ASSERT_EQ
(
""
,
uri
.
path
());
ASSERT_EQ
(
""
,
uri
.
user_info
());
ASSERT_EQ
(
""
,
uri
.
fragment
());
ASSERT_EQ
(
2
,
uri
.
QueryCount
());
ASSERT_EQ
(
2
u
,
uri
.
QueryCount
());
ASSERT_TRUE
(
uri
.
GetQuery
(
"wd"
));
ASSERT_EQ
(
*
uri
.
GetQuery
(
"wd"
),
"uri2"
);
ASSERT_TRUE
(
uri
.
GetQuery
(
"nonkey"
));
...
...
test/iobuf_unittest.cpp
View file @
9cec466e
...
...
@@ -290,7 +290,7 @@ TEST_F(IOBufTest, reserve) {
ASSERT_EQ
((
size_t
)
16
,
b
.
size
());
// pop/append sth. from back-side and assign again.
ASSERT_EQ
(
5
,
b
.
pop_back
(
5
));
ASSERT_EQ
(
(
size_t
)
5
,
b
.
pop_back
(
5
));
ASSERT_EQ
(
"prefihello "
,
b
.
to_string
());
b
.
append
(
"blahblahfoobar"
);
ASSERT_EQ
(
0
,
b
.
unsafe_assign
(
a1
,
"goodorbad"
));
// `x' will not be copied
...
...
@@ -1312,7 +1312,7 @@ TEST_F(IOBufTest, append_from_fd_with_offset) {
ASSERT_EQ
((
ssize_t
)
sizeof
(
dummy
),
buf
.
cut_into_file_descriptor
(
fd
));
for
(
size_t
i
=
0
;
i
<
sizeof
(
dummy
);
++
i
)
{
butil
::
IOPortal
b0
;
ASSERT_EQ
(
sizeof
(
dummy
)
-
i
,
b0
.
pappend_from_file_descriptor
(
fd
,
i
,
sizeof
(
dummy
)))
<<
berror
();
ASSERT_EQ
(
sizeof
(
dummy
)
-
i
,
(
size_t
)
b0
.
pappend_from_file_descriptor
(
fd
,
i
,
sizeof
(
dummy
)))
<<
berror
();
char
tmp
[
sizeof
(
dummy
)];
ASSERT_EQ
(
0
,
memcmp
(
dummy
+
i
,
b0
.
fetch
(
tmp
,
b0
.
length
()),
b0
.
length
()));
}
...
...
test/temp_file_unittest.cpp
View file @
9cec466e
...
...
@@ -139,7 +139,7 @@ TEST_F(TempFileTest, save_binary_twice)
fp
=
fopen
(
tmp
.
fname
(),
"r"
);
ASSERT_NE
((
void
*
)
0
,
fp
);
bzero
(
&
act_data
,
sizeof
(
act_data
));
ASSERT_EQ
(
1
,
fread
(
&
act_data
,
sizeof
(
act_data
),
1
,
fp
));
ASSERT_EQ
(
(
size_t
)
1
,
fread
(
&
act_data
,
sizeof
(
act_data
),
1
,
fp
));
fclose
(
fp
);
ASSERT_EQ
(
0
,
memcmp
(
&
data2
,
&
act_data
,
sizeof
(
data2
)));
...
...
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