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
ce673b55
Commit
ce673b55
authored
Sep 19, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak params of some UT
parent
2a1d50d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
brpc_builtin_service_unittest.cpp
test/brpc_builtin_service_unittest.cpp
+2
-2
bthread_cond_unittest.cpp
test/bthread_cond_unittest.cpp
+1
-1
bvar_reducer_unittest.cpp
test/bvar_reducer_unittest.cpp
+2
-2
No files found.
test/brpc_builtin_service_unittest.cpp
View file @
ce673b55
...
...
@@ -648,8 +648,8 @@ TEST_F(BuiltinServiceTest, pprof) {
ClosureChecker
done
;
brpc
::
Controller
cntl
;
service
.
heap
(
&
cntl
,
NULL
,
NULL
,
&
done
);
// MUST fail since tcmalloc hasn't been linked in
EXPECT_EQ
(
brpc
::
ENOMETHOD
,
cntl
.
ErrorCode
());
const
int
rc
=
getenv
(
"TCMALLOC_SAMPLE_PARAMETER"
)
?
0
:
brpc
::
ENOMETHOD
;
EXPECT_EQ
(
rc
,
cntl
.
ErrorCode
());
}
{
ClosureChecker
done
;
...
...
test/bthread_cond_unittest.cpp
View file @
ce673b55
...
...
@@ -105,7 +105,7 @@ TEST(CondTest, sanity) {
long
delta
=
wake_time
[
i
]
-
last_time
-
SIGNAL_INTERVAL_US
;
EXPECT_GT
(
wake_time
[
i
],
last_time
);
square_sum
+=
delta
*
delta
;
EXPECT_LT
(
abs
(
delta
),
1
000L
)
<<
"error["
<<
i
<<
"]="
<<
delta
<<
"="
EXPECT_LT
(
abs
(
delta
),
2
000L
)
<<
"error["
<<
i
<<
"]="
<<
delta
<<
"="
<<
wake_time
[
i
]
<<
" - "
<<
last_time
;
}
printf
(
"Average error is %fus
\n
"
,
sqrt
(
square_sum
/
std
::
max
(
nbeforestop
,
1UL
)));
...
...
test/bvar_reducer_unittest.cpp
View file @
ce673b55
...
...
@@ -49,7 +49,7 @@ TEST_F(ReducerTest, adder) {
ASSERT_EQ
(
-
5
,
reducer3
.
get_value
());
}
const
size_t
OPS_PER_THREAD
=
500000
0
;
const
size_t
OPS_PER_THREAD
=
500000
;
static
void
*
thread_counter
(
void
*
arg
)
{
bvar
::
Adder
<
uint64_t
>
*
reducer
=
(
bvar
::
Adder
<
uint64_t
>
*
)
arg
;
...
...
@@ -297,7 +297,7 @@ TEST_F(ReducerTest, non_primitive_mt) {
for
(
size_t
i
=
0
;
i
<
arraysize
(
th
);
++
i
)
{
pthread_create
(
&
th
[
i
],
NULL
,
string_appender
,
&
cater
);
}
usleep
(
1
0000
);
usleep
(
5
0000
);
g_stop
=
true
;
butil
::
hash_map
<
pthread_t
,
int
>
appended_count
;
for
(
size_t
i
=
0
;
i
<
arraysize
(
th
);
++
i
)
{
...
...
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