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
7c95d834
Commit
7c95d834
authored
Oct 01, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Works around a Symbian compiler bug that causes memory leak (by Mika Raento).
parent
79643f51
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
gmock-spec-builders.h
include/gmock/gmock-spec-builders.h
+10
-3
gmock-spec-builders.cc
src/gmock-spec-builders.cc
+8
-0
No files found.
include/gmock/gmock-spec-builders.h
View file @
7c95d834
...
@@ -351,10 +351,18 @@ class Mock {
...
@@ -351,10 +351,18 @@ class Mock {
// - Constness is shallow: a const Expectation object itself cannot
// - Constness is shallow: a const Expectation object itself cannot
// be modified, but the mutable methods of the ExpectationBase
// be modified, but the mutable methods of the ExpectationBase
// object it references can be called via expectation_base().
// object it references can be called via expectation_base().
// - The constructors and destructor are defined out-of-line because
// the Symbian WINSCW compiler wants to otherwise instantiate them
// when it sees this class definition, at which point it doesn't have
// ExpectationBase available yet, leading to incorrect destruction
// in the linked_ptr (or compilation errors if using a checking
// linked_ptr).
class
Expectation
{
class
Expectation
{
public
:
public
:
// Constructs a null object that doesn't reference any expectation.
// Constructs a null object that doesn't reference any expectation.
Expectation
()
{}
Expectation
();
~
Expectation
();
// This single-argument ctor must not be explicit, in order to support the
// This single-argument ctor must not be explicit, in order to support the
// Expectation e = EXPECT_CALL(...);
// Expectation e = EXPECT_CALL(...);
...
@@ -399,8 +407,7 @@ class Expectation {
...
@@ -399,8 +407,7 @@ class Expectation {
typedef
::
std
::
set
<
Expectation
,
Less
>
Set
;
typedef
::
std
::
set
<
Expectation
,
Less
>
Set
;
Expectation
(
Expectation
(
const
internal
::
linked_ptr
<
internal
::
ExpectationBase
>&
expectation_base
)
:
const
internal
::
linked_ptr
<
internal
::
ExpectationBase
>&
expectation_base
);
expectation_base_
(
expectation_base
)
{}
// Returns the expectation this object references.
// Returns the expectation this object references.
const
internal
::
linked_ptr
<
internal
::
ExpectationBase
>&
const
internal
::
linked_ptr
<
internal
::
ExpectationBase
>&
...
...
src/gmock-spec-builders.cc
View file @
7c95d834
...
@@ -420,6 +420,14 @@ void Mock::ClearDefaultActionsLocked(void* mock_obj) {
...
@@ -420,6 +420,14 @@ void Mock::ClearDefaultActionsLocked(void* mock_obj) {
// needed by VerifyAndClearExpectationsLocked().
// needed by VerifyAndClearExpectationsLocked().
}
}
Expectation
::
Expectation
()
{}
Expectation
::
Expectation
(
const
internal
::
linked_ptr
<
internal
::
ExpectationBase
>&
expectation_base
)
:
expectation_base_
(
expectation_base
)
{}
Expectation
::~
Expectation
()
{}
// Adds an expectation to a sequence.
// Adds an expectation to a sequence.
void
Sequence
::
AddExpectation
(
const
Expectation
&
expectation
)
const
{
void
Sequence
::
AddExpectation
(
const
Expectation
&
expectation
)
const
{
if
(
*
last_expectation_
!=
expectation
)
{
if
(
*
last_expectation_
!=
expectation
)
{
...
...
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