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
3e706bd9
Commit
3e706bd9
authored
Oct 24, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove warnings in UT
parent
25693a82
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
snappy.cc
src/butil/third_party/snappy/snappy.cc
+1
-1
file_watcher_unittest.cpp
test/file_watcher_unittest.cpp
+6
-6
iobuf_unittest.cpp
test/iobuf_unittest.cpp
+1
-1
temp_file_unittest.cpp
test/temp_file_unittest.cpp
+2
-2
No files found.
src/butil/third_party/snappy/snappy.cc
View file @
3e706bd9
...
...
@@ -564,7 +564,7 @@ static uint16_t MakeEntry(unsigned int extra,
return len | (copy_offset << 8) | (extra << 11);
}
static void ComputeTable() {
static void
ALLOW_UNUSED
ComputeTable() {
uint16_t dst[256];
// Place invalid entries in all places to detect missing initialization
...
...
test/file_watcher_unittest.cpp
View file @
3e706bd9
...
...
@@ -14,8 +14,7 @@ protected:
};
//! gejun: check basic functions of butil::FileWatcher
TEST_F
(
FileWatcherTest
,
random_op
)
{
TEST_F
(
FileWatcherTest
,
random_op
)
{
srand
(
time
(
0
));
butil
::
FileWatcher
fw
;
...
...
@@ -42,11 +41,11 @@ TEST_F(FileWatcherTest, random_op)
switch
(
rand
()
%
2
)
{
case
0
:
system
(
"touch dummy_file"
);
ASSERT_EQ
(
0
,
system
(
"touch dummy_file"
)
);
LOG
(
INFO
)
<<
"action: touch dummy_file"
;
break
;
case
1
:
system
(
"rm -f dummy_file"
);
ASSERT_EQ
(
0
,
system
(
"rm -f dummy_file"
)
);
LOG
(
INFO
)
<<
"action: rm -f dummy_file"
;
break
;
case
2
:
...
...
@@ -56,6 +55,7 @@ TEST_F(FileWatcherTest, random_op)
usleep
(
10000
);
}
system
(
"rm -f dummy_file"
);
ASSERT_EQ
(
0
,
system
(
"rm -f dummy_file"
)
);
}
}
}
// namespace
test/iobuf_unittest.cpp
View file @
3e706bd9
...
...
@@ -77,7 +77,7 @@ void show_prof_and_rm(const char* bin_name, const char* filename, size_t topn) {
}
else
{
snprintf
(
cmd
,
sizeof
(
cmd
),
"if [ -e %s ] ; then CPUPROFILE_FREQUENCY=1000 ./pprof --text %s %s; rm -f %s; fi"
,
filename
,
bin_name
,
filename
,
filename
);
}
system
(
cmd
);
ASSERT_EQ
(
0
,
system
(
cmd
)
);
}
static
void
check_memory_leak
()
{
...
...
test/temp_file_unittest.cpp
View file @
3e706bd9
...
...
@@ -127,7 +127,7 @@ TEST_F(TempFileTest, save_binary_twice)
ASSERT_NE
((
void
*
)
0
,
fp
);
test_t
act_data
;
bzero
(
&
act_data
,
sizeof
(
act_data
));
fread
(
&
act_data
,
sizeof
(
act_data
),
1
,
fp
);
ASSERT_EQ
(
1
,
fread
(
&
act_data
,
sizeof
(
act_data
),
1
,
fp
)
);
fclose
(
fp
);
ASSERT_EQ
(
0
,
memcmp
(
&
data
,
&
act_data
,
sizeof
(
data
)));
...
...
@@ -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
));
fread
(
&
act_data
,
sizeof
(
act_data
),
1
,
fp
);
ASSERT_EQ
(
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