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
e56daa7d
Commit
e56daa7d
authored
Nov 18, 2009
by
vladlosev
Browse files
Tests NotNull/IsNull with testing::internal::scoped_ptr.
parent
b006f165
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
test/gmock-matchers_test.cc
test/gmock-matchers_test.cc
+19
-0
No files found.
test/gmock-matchers_test.cc
View file @
e56daa7d
...
...
@@ -122,6 +122,7 @@ using testing::internal::kInvalidInterpolation;
using
testing
::
internal
::
kPercentInterpolation
;
using
testing
::
internal
::
kTupleInterpolation
;
using
testing
::
internal
::
linked_ptr
;
using
testing
::
internal
::
scoped_ptr
;
using
testing
::
internal
::
string
;
#ifdef GMOCK_HAS_REGEX
...
...
@@ -734,6 +735,15 @@ TEST(IsNullTest, ReferenceToConstLinkedPtr) {
EXPECT_FALSE
(
m
.
Matches
(
non_null_p
));
}
TEST
(
IsNullTest
,
ReferenceToConstScopedPtr
)
{
const
Matcher
<
const
scoped_ptr
<
double
>&>
m
=
IsNull
();
const
scoped_ptr
<
double
>
null_p
;
const
scoped_ptr
<
double
>
non_null_p
(
new
double
);
EXPECT_TRUE
(
m
.
Matches
(
null_p
));
EXPECT_FALSE
(
m
.
Matches
(
non_null_p
));
}
// Tests that IsNull() describes itself properly.
TEST
(
IsNullTest
,
CanDescribeSelf
)
{
Matcher
<
int
*>
m
=
IsNull
();
...
...
@@ -773,6 +783,15 @@ TEST(NotNullTest, ReferenceToConstLinkedPtr) {
EXPECT_TRUE
(
m
.
Matches
(
non_null_p
));
}
TEST
(
NotNullTest
,
ReferenceToConstScopedPtr
)
{
const
Matcher
<
const
scoped_ptr
<
double
>&>
m
=
NotNull
();
const
scoped_ptr
<
double
>
null_p
;
const
scoped_ptr
<
double
>
non_null_p
(
new
double
);
EXPECT_FALSE
(
m
.
Matches
(
null_p
));
EXPECT_TRUE
(
m
.
Matches
(
non_null_p
));
}
// Tests that NotNull() describes itself properly.
TEST
(
NotNullTest
,
CanDescribeSelf
)
{
Matcher
<
int
*>
m
=
NotNull
();
...
...
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