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
208c2f6b
Commit
208c2f6b
authored
Oct 25, 2019
by
Piotr Nycz
Browse files
variable names corrected (followed google coding style)
Issue 2527
parent
5ff72f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
googlemock/test/gmock-actions_test.cc
googlemock/test/gmock-actions_test.cc
+14
-14
No files found.
googlemock/test/gmock-actions_test.cc
View file @
208c2f6b
...
...
@@ -653,33 +653,33 @@ bool CanCallReturnRef(Unused) { return false; }
// Tests that ReturnRef(v) is working with non-temporaries (T&)
TEST
(
ReturnRefTest
,
WorksForNonTemporary
)
{
int
scalar
V
alue
=
123
;
EXPECT_TRUE
(
CanCallReturnRef
(
scalar
V
alue
));
int
scalar
_v
alue
=
123
;
EXPECT_TRUE
(
CanCallReturnRef
(
scalar
_v
alue
));
std
::
string
non
S
calar
V
alue
(
"ABC"
);
EXPECT_TRUE
(
CanCallReturnRef
(
non
S
calar
V
alue
));
std
::
string
non
_s
calar
_v
alue
(
"ABC"
);
EXPECT_TRUE
(
CanCallReturnRef
(
non
_s
calar
_v
alue
));
const
int
const
S
calar
V
alue
{
321
};
EXPECT_TRUE
(
CanCallReturnRef
(
const
S
calar
V
alue
));
const
int
const
_s
calar
_v
alue
{
321
};
EXPECT_TRUE
(
CanCallReturnRef
(
const
_s
calar
_v
alue
));
const
std
::
string
const
NonS
calar
V
alue
(
"CBA"
);
EXPECT_TRUE
(
CanCallReturnRef
(
const
NonS
calar
V
alue
));
const
std
::
string
const
_non_s
calar
_v
alue
(
"CBA"
);
EXPECT_TRUE
(
CanCallReturnRef
(
const
_non_s
calar
_v
alue
));
}
// Tests that ReturnRef(v) is not working with temporaries (T&&)
TEST
(
ReturnRefTest
,
DoesNotWorkForTemporary
)
{
auto
scalar
V
alue
=
[]()
->
int
{
return
123
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
scalar
V
alue
()));
auto
scalar
_v
alue
=
[]()
->
int
{
return
123
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
scalar
_v
alue
()));
auto
non
S
calar
V
alue
=
[]()
->
std
::
string
{
return
"ABC"
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
non
S
calar
V
alue
()));
auto
non
_s
calar
_v
alue
=
[]()
->
std
::
string
{
return
"ABC"
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
non
_s
calar
_v
alue
()));
// cannot use here callable returning "const scalar type",
// because such const for scalar return type is ignored
EXPECT_FALSE
(
CanCallReturnRef
(
static_cast
<
const
int
>
(
321
)));
auto
const
NonS
calar
V
alue
=
[]()
->
const
std
::
string
{
return
"CBA"
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
const
NonS
calar
V
alue
()));
auto
const
_non_s
calar
_v
alue
=
[]()
->
const
std
::
string
{
return
"CBA"
;
};
EXPECT_FALSE
(
CanCallReturnRef
(
const
_non_s
calar
_v
alue
()));
}
// Tests that ReturnRefOfCopy(v) works for reference types.
...
...
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