Skip to content

Commit

Permalink
Add a comment on using empty ctor for mock classes derived from GObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Gruber committed Jul 10, 2020
1 parent 3d92d53 commit 861a248
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libgnucash/engine/mocks/gmock-Account.h
Expand Up @@ -20,6 +20,9 @@ GType gnc_mock_account_get_type(void);
class MockAccount : public Account
{
public:
// note: don't use default constructor instead of empty constructor, since
// it does zero initialization, which would overwrite GObject
// initialization, which is already done in the new operator.
MockAccount() {}
void* operator new(size_t size)
{
Expand Down

0 comments on commit 861a248

Please sign in to comment.