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
eb9225ce
Commit
eb9225ce
authored
Jan 14, 2019
by
misterg
Committed by
Gennadiy Civil
Jan 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Change remaining samples to use new Test Suite API PiperOrigin-RevId: 229231566
parent
9acd065a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
sample6_unittest.cc
googletest/samples/sample6_unittest.cc
+6
-6
sample7_unittest.cc
googletest/samples/sample7_unittest.cc
+3
-3
sample8_unittest.cc
googletest/samples/sample8_unittest.cc
+2
-3
No files found.
googletest/samples/sample6_unittest.cc
View file @
eb9225ce
...
...
@@ -92,7 +92,7 @@ using testing::Types;
// The list of types we want to test.
typedef
Types
<
OnTheFlyPrimeTable
,
PreCalculatedPrimeTable
>
Implementations
;
TYPED_TEST_
CAS
E
(
PrimeTableTest
,
Implementations
);
TYPED_TEST_
SUIT
E
(
PrimeTableTest
,
Implementations
);
// Then use TYPED_TEST(TestCaseName, TestName) to define a typed test,
// similar to TEST_F.
...
...
@@ -163,7 +163,7 @@ class PrimeTableTest2 : public PrimeTableTest<T> {
// Then, declare the test case. The argument is the name of the test
// fixture, and also the name of the test case (as usual). The _P
// suffix is for "parameterized" or "pattern".
TYPED_TEST_
CAS
E_P
(
PrimeTableTest2
);
TYPED_TEST_
SUIT
E_P
(
PrimeTableTest2
);
// Next, use TYPED_TEST_P(TestCaseName, TestName) to define a test,
// similar to what you do with TEST_F.
...
...
@@ -196,7 +196,7 @@ TYPED_TEST_P(PrimeTableTest2, CanGetNextPrime) {
// Type-parameterized tests involve one extra step: you have to
// enumerate the tests you defined:
REGISTER_TYPED_TEST_
CAS
E_P
(
REGISTER_TYPED_TEST_
SUIT
E_P
(
PrimeTableTest2
,
// The first argument is the test case name.
// The rest of the arguments are the test names.
ReturnsFalseForNonPrimes
,
ReturnsTrueForPrimes
,
CanGetNextPrime
);
...
...
@@ -216,9 +216,9 @@ REGISTER_TYPED_TEST_CASE_P(
// defined at the time we write the TYPED_TEST_P()s.
typedef
Types
<
OnTheFlyPrimeTable
,
PreCalculatedPrimeTable
>
PrimeTableImplementations
;
INSTANTIATE_TYPED_TEST_
CAS
E_P
(
OnTheFlyAndPreCalculated
,
// Instance name
PrimeTableTest2
,
// Test case name
PrimeTableImplementations
);
// Type list
INSTANTIATE_TYPED_TEST_
SUIT
E_P
(
OnTheFlyAndPreCalculated
,
// Instance name
PrimeTableTest2
,
// Test case name
PrimeTableImplementations
);
// Type list
#endif // GTEST_HAS_TYPED_TEST_P
}
// namespace
googletest/samples/sample7_unittest.cc
View file @
eb9225ce
...
...
@@ -110,8 +110,8 @@ TEST_P(PrimeTableTestSmpl7, CanGetNextPrime) {
//
// Here, we instantiate our tests with a list of two PrimeTable object
// factory functions:
INSTANTIATE_TEST_
CAS
E_P
(
OnTheFlyAndPreCalculated
,
PrimeTableTestSmpl7
,
Values
(
&
CreateOnTheFlyPrimeTable
,
&
CreatePreCalculatedPrimeTable
<
1000
>
));
INSTANTIATE_TEST_
SUIT
E_P
(
OnTheFlyAndPreCalculated
,
PrimeTableTestSmpl7
,
Values
(
&
CreateOnTheFlyPrimeTable
,
&
CreatePreCalculatedPrimeTable
<
1000
>
));
}
// namespace
googletest/samples/sample8_unittest.cc
View file @
eb9225ce
...
...
@@ -148,8 +148,7 @@ TEST_P(PrimeTableTest, CanGetNextPrime) {
// will put some of the tested numbers beyond the capability of the
// PrecalcPrimeTable instance and some inside it (10). Combine will produce all
// possible combinations.
INSTANTIATE_TEST_CASE_P
(
MeaningfulTestParameters
,
PrimeTableTest
,
Combine
(
Bool
(),
Values
(
1
,
10
)));
INSTANTIATE_TEST_SUITE_P
(
MeaningfulTestParameters
,
PrimeTableTest
,
Combine
(
Bool
(),
Values
(
1
,
10
)));
}
// namespace
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