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
e2839305
Commit
e2839305
authored
May 06, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings.
parent
72ad3781
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
test/gtest-extra-test.cc
test/gtest-extra-test.cc
+8
-5
No files found.
test/gtest-extra-test.cc
View file @
e2839305
...
...
@@ -39,10 +39,11 @@
namespace
{
#ifdef _WIN32
// Suppresses Windows assertions on invalid file descriptors, making
// POSIX functions return proper error codes instead of crashing on Windows.
class
SuppressAssert
{
#ifdef _WIN32
private:
_invalid_parameter_handler
original_handler_
;
int
original_report_mode_
;
...
...
@@ -59,10 +60,12 @@ class SuppressAssert {
_set_invalid_parameter_handler
(
original_handler_
);
_CrtSetReportMode
(
_CRT_ASSERT
,
original_report_mode_
);
}
#endif // _WIN32
};
#define SUPPRESS_ASSERT(statement) { SuppressAssert sa; statement; }
# define SUPPRESS_ASSERT(statement) { SuppressAssert sa; statement; }
#else
# define SUPPRESS_ASSERT(statement) statement
#endif // _WIN32
#define EXPECT_SYSTEM_ERROR_NOASSERT(statement, error_code, message) \
EXPECT_SYSTEM_ERROR(SUPPRESS_ASSERT(statement), error_code, message)
...
...
@@ -182,7 +185,7 @@ TEST(AssertionSyntaxTest, ExceptionAssertionBehavesLikeSingleStatement) {
if
(
::
testing
::
internal
::
AlwaysTrue
())
EXPECT_THROW_MSG
(
ThrowException
(),
std
::
exception
,
"test"
);
else
;
// NOLINT
DoNothing
();
}
TEST
(
AssertionSyntaxTest
,
WriteAssertionBehavesLikeSingleStatement
)
{
...
...
@@ -192,7 +195,7 @@ TEST(AssertionSyntaxTest, WriteAssertionBehavesLikeSingleStatement) {
if
(
::
testing
::
internal
::
AlwaysTrue
())
EXPECT_WRITE
(
stdout
,
std
::
printf
(
"x"
),
"x"
);
else
;
// NOLINT
DoNothing
();
}
// Tests EXPECT_THROW_MSG.
...
...
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