Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
86e5f008
Commit
86e5f008
authored
Feb 10, 2016
by
Bernhard Bauer
Browse files
Add a non-parametrized test.
parent
e7c9e80e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
googletest/test/gtest-param-test_test.cc
googletest/test/gtest-param-test_test.cc
+12
-0
No files found.
googletest/test/gtest-param-test_test.cc
View file @
86e5f008
...
@@ -825,6 +825,18 @@ TEST_P(PREFIX_WITH_MACRO(NamingTest), PREFIX_WITH_FOO(SomeTestName)) {
...
@@ -825,6 +825,18 @@ TEST_P(PREFIX_WITH_MACRO(NamingTest), PREFIX_WITH_FOO(SomeTestName)) {
INSTANTIATE_TEST_CASE_P
(
FortyTwo
,
MacroNamingTest
,
Values
(
42
));
INSTANTIATE_TEST_CASE_P
(
FortyTwo
,
MacroNamingTest
,
Values
(
42
));
// Tests the same thing for non-parametrized tests.
class
MacroNamingTestNonParametrized
:
public
::
testing
::
Test
{};
TEST_F
(
PREFIX_WITH_MACRO
(
NamingTestNonParametrized
),
PREFIX_WITH_FOO
(
SomeTestName
))
{
const
::
testing
::
TestInfo
*
const
test_info
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
EXPECT_STREQ
(
"MacroNamingTestNonParametrized"
,
test_info
->
test_case_name
());
EXPECT_STREQ
(
"FOO_SomeTestName"
,
test_info
->
name
());
}
// Tests that user supplied custom parameter names are working correctly.
// Tests that user supplied custom parameter names are working correctly.
// Runs the test with a builtin helper method which uses PrintToString,
// Runs the test with a builtin helper method which uses PrintToString,
// as well as a custom function and custom functor to ensure all possible
// as well as a custom function and custom functor to ensure all possible
...
...
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