Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
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
fmt
Commits
d13946bf
Commit
d13946bf
authored
May 03, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings.
parent
1a6d365d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
test/gtest-extra-test.cc
test/gtest-extra-test.cc
+3
-3
test/gtest-extra.cc
test/gtest-extra.cc
+2
-2
No files found.
test/gtest-extra-test.cc
View file @
d13946bf
...
...
@@ -154,12 +154,12 @@ TEST(FileTest, DefaultCtor) {
// Checks if the file is open by reading one character from it.
bool
IsOpen
(
int
fd
)
{
char
buffer
;
return
read
(
fd
,
&
buffer
,
1
)
==
1
;
return
FMT_POSIX
(
read
(
fd
,
&
buffer
,
1
)
)
==
1
;
}
bool
IsClosedInternal
(
int
fd
)
{
char
buffer
;
std
::
streamsize
result
=
read
(
fd
,
&
buffer
,
1
);
std
::
streamsize
result
=
FMT_POSIX
(
read
(
fd
,
&
buffer
,
1
)
);
return
result
==
-
1
&&
errno
==
EBADF
;
}
...
...
@@ -248,7 +248,7 @@ TEST(FileTest, DtorCloseError) {
// The close function must be called inside EXPECT_STDERR, otherwise
// the system may allocate freed file descriptor when redirecting the
// output in EXPECT_STDERR.
EXPECT_STDERR
(
close
(
f
->
descriptor
(
));
delete
f
,
EXPECT_STDERR
(
FMT_POSIX
(
close
(
f
->
descriptor
()
));
delete
f
,
FormatSystemErrorMessage
(
EBADF
,
"cannot close file"
)
+
"
\n
"
);
}
...
...
test/gtest-extra.cc
View file @
d13946bf
...
...
@@ -165,7 +165,7 @@ std::string OutputRedirector::Read() {
// Restore output.
if
(
std
::
fflush
(
file_
)
!=
0
)
fmt
::
ThrowSystemError
(
errno
,
"cannot flush stream"
);
saved_
.
dup2
(
fileno
(
file_
));
saved_
.
dup2
(
FMT_POSIX
(
fileno
(
file_
)
));
// Read everything from the pipe.
std
::
string
content
;
...
...
@@ -174,7 +174,7 @@ std::string OutputRedirector::Read() {
std
::
streamsize
count
=
0
;
do
{
count
=
read_end_
.
read
(
buffer
,
BUFFER_SIZE
);
content
.
append
(
buffer
,
count
);
content
.
append
(
buffer
,
static_cast
<
std
::
size_t
>
(
count
)
);
}
while
(
count
!=
0
);
return
content
;
}
...
...
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