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
58b762f9
Commit
58b762f9
authored
May 03, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests.
parent
ba89c639
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
test/gtest-extra-test.cc
test/gtest-extra-test.cc
+10
-2
No files found.
test/gtest-extra-test.cc
View file @
58b762f9
...
...
@@ -44,6 +44,14 @@ std::string FormatSystemErrorMessage(int error_code, fmt::StringRef message) {
EXPECT_THROW_MSG(statement, fmt::SystemError, \
FormatSystemErrorMessage(error_code, message))
#ifndef _WIN32
# define EXPECT_SYSTEM_ERROR_OR_DEATH(statement, error_code, message) \
EXPECT_SYSTEM_ERROR(statement, error_code, message)
#else
# define EXPECT_SYSTEM_ERROR_OR_DEATH(statement, error_code, message) \
EXPECT_DEATH(statement, "")
#endif
// Tests that assertion macros evaluate their arguments exactly once.
class
SingleEvaluationTest
:
public
::
testing
::
Test
{
protected:
...
...
@@ -327,7 +335,7 @@ TEST(FileTest, Read) {
TEST
(
FileTest
,
ReadError
)
{
File
f
;
char
buf
;
EXPECT_SYSTEM_ERROR
(
f
.
read
(
&
buf
,
1
),
EBADF
,
"cannot read from file"
);
EXPECT_SYSTEM_ERROR
_OR_DEATH
(
f
.
read
(
&
buf
,
1
),
EBADF
,
"cannot read from file"
);
}
TEST
(
FileTest
,
Write
)
{
...
...
@@ -340,7 +348,7 @@ TEST(FileTest, Write) {
TEST
(
FileTest
,
WriteError
)
{
File
f
;
EXPECT_SYSTEM_ERROR
(
f
.
write
(
" "
,
1
),
EBADF
,
"cannot write to file"
);
EXPECT_SYSTEM_ERROR
_OR_DEATH
(
f
.
write
(
" "
,
1
),
EBADF
,
"cannot write to file"
);
}
TEST
(
FileTest
,
Dup
)
{
...
...
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