Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
d629744e
Commit
d629744e
authored
Jan 15, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code merges
parent
6c865988
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
gtest.h
googletest/include/gtest/gtest.h
+15
-18
No files found.
googletest/include/gtest/gtest.h
View file @
d629744e
...
@@ -563,9 +563,8 @@ class GTEST_API_ TestResult {
...
@@ -563,9 +563,8 @@ class GTEST_API_ TestResult {
// Returns the elapsed time, in milliseconds.
// Returns the elapsed time, in milliseconds.
TimeInMillis
elapsed_time
()
const
{
return
elapsed_time_
;
}
TimeInMillis
elapsed_time
()
const
{
return
elapsed_time_
;
}
// Returns the i-th test part result among all the results. i can range
// Returns the i-th test part result among all the results. i can range from 0
// from 0 to test_property_count() - 1. If i is not in that range, aborts
// to total_part_count() - 1. If i is not in that range, aborts the program.
// the program.
const
TestPartResult
&
GetTestPartResult
(
int
i
)
const
;
const
TestPartResult
&
GetTestPartResult
(
int
i
)
const
;
// Returns the i-th test property. i can range from 0 to
// Returns the i-th test property. i can range from 0 to
...
@@ -688,6 +687,9 @@ class GTEST_API_ TestInfo {
...
@@ -688,6 +687,9 @@ class GTEST_API_ TestInfo {
// Returns the line where this test is defined.
// Returns the line where this test is defined.
int
line
()
const
{
return
location_
.
line
;
}
int
line
()
const
{
return
location_
.
line
;
}
// Return true if this test should not be run because it's in another shard.
bool
is_in_another_shard
()
const
{
return
is_in_another_shard_
;
}
// Returns true if this test should run, that is if the test is not
// Returns true if this test should run, that is if the test is not
// disabled (or it is disabled but the also_run_disabled_tests flag has
// disabled (or it is disabled but the also_run_disabled_tests flag has
// been specified) and its full name matches the user-specified filter.
// been specified) and its full name matches the user-specified filter.
...
@@ -708,10 +710,9 @@ class GTEST_API_ TestInfo {
...
@@ -708,10 +710,9 @@ class GTEST_API_ TestInfo {
// Returns true iff this test will appear in the XML report.
// Returns true iff this test will appear in the XML report.
bool
is_reportable
()
const
{
bool
is_reportable
()
const
{
// For now, the XML report includes all tests matching the filter.
// The XML report includes tests matching the filter, excluding those
// In the future, we may trim tests that are excluded because of
// run in other shards.
// sharding.
return
matches_filter_
&&
!
is_in_another_shard_
;
return
matches_filter_
;
}
}
// Returns the result of the test.
// Returns the result of the test.
...
@@ -775,6 +776,7 @@ class GTEST_API_ TestInfo {
...
@@ -775,6 +776,7 @@ class GTEST_API_ TestInfo {
bool
is_disabled_
;
// True iff this test is disabled
bool
is_disabled_
;
// True iff this test is disabled
bool
matches_filter_
;
// True if this test matches the
bool
matches_filter_
;
// True if this test matches the
// user-specified filter.
// user-specified filter.
bool
is_in_another_shard_
;
// Will be run in another shard.
internal
::
TestFactoryBase
*
const
factory_
;
// The factory that creates
internal
::
TestFactoryBase
*
const
factory_
;
// The factory that creates
// the test object
// the test object
...
@@ -1791,7 +1793,6 @@ template <typename T>
...
@@ -1791,7 +1793,6 @@ template <typename T>
class
TestWithParam
:
public
Test
,
public
WithParamInterface
<
T
>
{
class
TestWithParam
:
public
Test
,
public
WithParamInterface
<
T
>
{
};
};
// Macros for indicating success/failure in test code.
// Macros for indicating success/failure in test code.
// ADD_FAILURE unconditionally adds a failure to the current test.
// ADD_FAILURE unconditionally adds a failure to the current test.
...
@@ -1864,22 +1865,18 @@ class TestWithParam : public Test, public WithParamInterface<T> {
...
@@ -1864,22 +1865,18 @@ class TestWithParam : public Test, public WithParamInterface<T> {
// AssertionResult. For more information on how to use AssertionResult with
// AssertionResult. For more information on how to use AssertionResult with
// these macros see comments on that class.
// these macros see comments on that class.
#define EXPECT_TRUE(condition) \
#define EXPECT_TRUE(condition) \
GTEST_TEST_BOOLEAN_(
(condition)
, #condition, false, true, \
GTEST_TEST_BOOLEAN_(
condition
, #condition, false, true, \
GTEST_NONFATAL_FAILURE_)
GTEST_NONFATAL_FAILURE_)
#define EXPECT_FALSE(condition) \
#define EXPECT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_NONFATAL_FAILURE_)
GTEST_NONFATAL_FAILURE_)
#define ASSERT_TRUE(condition) \
#define ASSERT_TRUE(condition) \
GTEST_TEST_BOOLEAN_(
(condition)
, #condition, false, true, \
GTEST_TEST_BOOLEAN_(
condition
, #condition, false, true, \
GTEST_FATAL_FAILURE_)
GTEST_FATAL_FAILURE_)
#define ASSERT_FALSE(condition) \
#define ASSERT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_FATAL_FAILURE_)
GTEST_FATAL_FAILURE_)
// Includes the auto-generated header that implements a family of
// generic predicate assertion macros.
#include "gtest/gtest_pred_impl.h"
// Macros for testing equalities and inequalities.
// Macros for testing equalities and inequalities.
//
//
// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
...
@@ -1921,8 +1918,8 @@ class TestWithParam : public Test, public WithParamInterface<T> {
...
@@ -1921,8 +1918,8 @@ class TestWithParam : public Test, public WithParamInterface<T> {
//
//
// Examples:
// Examples:
//
//
// EXPECT_NE(
5, Foo()
);
// EXPECT_NE(
Foo(), 5
);
// EXPECT_EQ(
NULL, a_pointer
);
// EXPECT_EQ(
a_pointer, NULL
);
// ASSERT_LT(i, array_size);
// ASSERT_LT(i, array_size);
// ASSERT_GT(records.size(), 0) << "There is no record left.";
// ASSERT_GT(records.size(), 0) << "There is no record left.";
...
@@ -2221,8 +2218,8 @@ bool StaticAssertTypeEq() {
...
@@ -2221,8 +2218,8 @@ bool StaticAssertTypeEq() {
// }
// }
//
//
// TEST_F(FooTest, ReturnsElementCountCorrectly) {
// TEST_F(FooTest, ReturnsElementCountCorrectly) {
// EXPECT_EQ(
0, a_.size()
);
// EXPECT_EQ(
a_.size(), 0
);
// EXPECT_EQ(
1, b_.size()
);
// EXPECT_EQ(
b_.size(), 1
);
// }
// }
#define TEST_F(test_fixture, test_name)\
#define TEST_F(test_fixture, test_name)\
...
...
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