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
22c662c8
Commit
22c662c8
authored
Aug 21, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix UT of base/errno.cpp
parent
9a826ef9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
errno.cpp
src/base/errno.cpp
+2
-2
errno_unittest.cpp
test/errno_unittest.cpp
+1
-1
No files found.
src/base/errno.cpp
View file @
22c662c8
...
...
@@ -53,7 +53,7 @@ int DescribeCustomizedErrno(
const
char
*
berror
(
int
error_code
)
{
if
(
error_code
==
-
1
)
{
return
"General
E
rror -1"
;
return
"General
e
rror -1"
;
}
if
(
error_code
>=
base
::
ERRNO_BEGIN
&&
error_code
<
base
::
ERRNO_END
)
{
const
char
*
s
=
base
::
errno_desc
[
error_code
-
base
::
ERRNO_BEGIN
];
...
...
@@ -66,7 +66,7 @@ const char* berror(int error_code) {
}
}
snprintf
(
base
::
tls_error_buf
,
base
::
ERROR_BUFSIZE
,
"Unknown
E
rror %d"
,
error_code
);
"Unknown
e
rror %d"
,
error_code
);
return
base
::
tls_error_buf
;
}
...
...
test/errno_unittest.cpp
View file @
22c662c8
...
...
@@ -39,7 +39,7 @@ TEST_F(ErrnoTest, customized_errno) {
ASSERT_STREQ
(
"the thread is interrupted"
,
berror
(
EBREAK
));
ASSERT_STREQ
(
"something happened"
,
berror
(
ESTH
));
ASSERT_STREQ
(
"OK!"
,
berror
(
EOK
));
ASSERT_STREQ
(
"Unknown
Error(1000)
"
,
berror
(
1000
));
ASSERT_STREQ
(
"Unknown
error 1000
"
,
berror
(
1000
));
errno
=
ESTOP
;
printf
(
"Something got wrong, %m
\n
"
);
...
...
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