mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Rename GObject type names of mock classes
According to a remark in PR #738 the lower case type name is changed. Underscores should only be used between namespace and type name and between type name and suffixes.
This commit is contained in:
parent
41c147a918
commit
5408854c28
@ -119,7 +119,7 @@ void
|
||||
qof_query_set_book (QofQuery *query, QofBook *book)
|
||||
{
|
||||
ASSERT_TRUE(queryPool.query_used(query));
|
||||
ASSERT_TRUE(QOF_IS_MOCK_BOOK(book));
|
||||
ASSERT_TRUE(QOF_IS_MOCKBOOK(book));
|
||||
((QofFakeQuery*)query)->set_book(book);
|
||||
}
|
||||
|
||||
|
@ -9,16 +9,16 @@ struct _MockAccountClass
|
||||
};
|
||||
typedef struct _MockAccountClass MockAccountClass;
|
||||
|
||||
G_DEFINE_TYPE(MockAccount, gnc_mock_account, QOF_TYPE_INSTANCE);
|
||||
G_DEFINE_TYPE(MockAccount, gnc_mockaccount, QOF_TYPE_INSTANCE);
|
||||
|
||||
static void
|
||||
gnc_mock_account_init (MockAccount *inst)
|
||||
gnc_mockaccount_init (MockAccount *inst)
|
||||
{
|
||||
// function is unused, initialization is done in the MockAccount's C++ constructor
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_mock_account_class_init(MockAccountClass *klass)
|
||||
gnc_mockaccount_class_init(MockAccountClass *klass)
|
||||
{
|
||||
// function is unused, class functions are defined in C++ code
|
||||
}
|
||||
@ -26,22 +26,22 @@ gnc_mock_account_class_init(MockAccountClass *klass)
|
||||
void
|
||||
xaccAccountBeginEdit (Account *account)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_ACCOUNT(account));
|
||||
ASSERT_TRUE(GNC_IS_MOCKACCOUNT(account));
|
||||
((MockAccount*)account)->begin_edit();
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountCommitEdit (Account *account)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_ACCOUNT(account));
|
||||
ASSERT_TRUE(GNC_IS_MOCKACCOUNT(account));
|
||||
((MockAccount*)account)->commit_edit();
|
||||
}
|
||||
|
||||
QofBook *
|
||||
gnc_account_get_book(const Account *account)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_ACCOUNT(account));
|
||||
if (GNC_IS_MOCK_ACCOUNT(account))
|
||||
EXPECT_TRUE(GNC_IS_MOCKACCOUNT(account));
|
||||
if (GNC_IS_MOCKACCOUNT(account))
|
||||
return ((MockAccount*)account)->get_book();
|
||||
else
|
||||
return nullptr;
|
||||
@ -51,8 +51,8 @@ gint
|
||||
xaccAccountForEachTransaction(const Account *acc, TransactionCallback proc,
|
||||
void *data)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_ACCOUNT(acc));
|
||||
if (GNC_IS_MOCK_ACCOUNT(acc))
|
||||
EXPECT_TRUE(GNC_IS_MOCKACCOUNT(acc));
|
||||
if (GNC_IS_MOCKACCOUNT(acc))
|
||||
return ((MockAccount*)acc)->for_each_transaction(proc, data);
|
||||
else
|
||||
return 0;
|
||||
@ -61,8 +61,8 @@ xaccAccountForEachTransaction(const Account *acc, TransactionCallback proc,
|
||||
GncImportMatchMap *
|
||||
gnc_account_imap_create_imap (Account *acc)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_ACCOUNT(acc));
|
||||
if (GNC_IS_MOCK_ACCOUNT(acc))
|
||||
EXPECT_TRUE(GNC_IS_MOCKACCOUNT(acc));
|
||||
if (GNC_IS_MOCKACCOUNT(acc))
|
||||
return ((MockAccount*)acc)->create_imap();
|
||||
else
|
||||
return nullptr;
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "gmock-gobject.h"
|
||||
|
||||
|
||||
GType gnc_mock_account_get_type(void);
|
||||
GType gnc_mockaccount_get_type(void);
|
||||
|
||||
#define GNC_TYPE_MOCK_ACCOUNT (gnc_mock_account_get_type ())
|
||||
#define GNC_IS_MOCK_ACCOUNT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCK_ACCOUNT))
|
||||
#define GNC_TYPE_MOCKACCOUNT (gnc_mockaccount_get_type ())
|
||||
#define GNC_IS_MOCKACCOUNT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCKACCOUNT))
|
||||
|
||||
|
||||
// mock up for Account
|
||||
@ -26,7 +26,7 @@ public:
|
||||
MockAccount() {}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return mock_g_object_new (GNC_TYPE_MOCK_ACCOUNT, NULL, size);
|
||||
return mock_g_object_new (GNC_TYPE_MOCKACCOUNT, NULL, size);
|
||||
}
|
||||
|
||||
// define separate free() function since destructor is protected
|
||||
|
@ -12,16 +12,16 @@ struct _MockSplitClass
|
||||
};
|
||||
typedef struct _MockSplitClass MockSplitClass;
|
||||
|
||||
G_DEFINE_TYPE(MockSplit, gnc_mock_split, QOF_TYPE_INSTANCE);
|
||||
G_DEFINE_TYPE(MockSplit, gnc_mocksplit, QOF_TYPE_INSTANCE);
|
||||
|
||||
static void
|
||||
gnc_mock_split_init (MockSplit *inst)
|
||||
gnc_mocksplit_init (MockSplit *inst)
|
||||
{
|
||||
// function is unused, initialization is done in the MockSplit's C++ constructor
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_mock_split_class_init (MockSplitClass *klass)
|
||||
gnc_mocksplit_class_init (MockSplitClass *klass)
|
||||
{
|
||||
// function is unused, class functions are defined in C++ code
|
||||
}
|
||||
@ -30,8 +30,8 @@ gnc_mock_split_class_init (MockSplitClass *klass)
|
||||
Split *
|
||||
xaccMallocSplit (QofBook *book)
|
||||
{
|
||||
EXPECT_TRUE(QOF_IS_MOCK_BOOK(book));
|
||||
if (QOF_IS_MOCK_BOOK(book))
|
||||
EXPECT_TRUE(QOF_IS_MOCKBOOK(book));
|
||||
if (QOF_IS_MOCKBOOK(book))
|
||||
return ((QofMockBook*)book)->malloc_split();
|
||||
else
|
||||
return nullptr;
|
||||
@ -40,8 +40,8 @@ xaccMallocSplit (QofBook *book)
|
||||
QofBook *
|
||||
xaccSplitGetBook (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_book();
|
||||
else
|
||||
return nullptr;
|
||||
@ -50,8 +50,8 @@ xaccSplitGetBook (const Split *split)
|
||||
Account *
|
||||
xaccSplitGetAccount (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_account();
|
||||
else
|
||||
return nullptr;
|
||||
@ -60,16 +60,16 @@ xaccSplitGetAccount (const Split *split)
|
||||
void
|
||||
xaccSplitSetAccount (Split *split, Account *acc)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCK_ACCOUNT(acc));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKACCOUNT(acc));
|
||||
((MockSplit*)split)->set_account(acc);
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetAmount (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_amount();
|
||||
else
|
||||
return gnc_numeric_zero();
|
||||
@ -78,15 +78,15 @@ xaccSplitGetAmount (const Split *split)
|
||||
void
|
||||
xaccSplitSetAmount (Split *split, gnc_numeric amt)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
((MockSplit*)split)->set_amount(amt);
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccSplitGetValue (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_value();
|
||||
else
|
||||
return gnc_numeric_zero();
|
||||
@ -95,15 +95,15 @@ xaccSplitGetValue (const Split *split)
|
||||
void
|
||||
xaccSplitSetValue (Split *split, gnc_numeric val)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
((MockSplit*)split)->set_value(val);
|
||||
}
|
||||
|
||||
const char *
|
||||
xaccSplitGetMemo (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_memo();
|
||||
else
|
||||
return nullptr;
|
||||
@ -112,8 +112,8 @@ xaccSplitGetMemo (const Split *split)
|
||||
char
|
||||
xaccSplitGetReconcile (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_reconcile();
|
||||
else
|
||||
return VREC;
|
||||
@ -122,22 +122,22 @@ xaccSplitGetReconcile (const Split *split)
|
||||
void
|
||||
xaccSplitSetReconcile (Split *split, char recn)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
((MockSplit*)split)->set_reconcile(recn);
|
||||
}
|
||||
|
||||
void
|
||||
xaccSplitSetDateReconciledSecs (Split *split, time64 secs)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
((MockSplit*)split)->set_date_reconciled_secs(secs);
|
||||
}
|
||||
|
||||
const char *
|
||||
xaccSplitGetAction (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_action();
|
||||
else
|
||||
return nullptr;
|
||||
@ -146,8 +146,8 @@ xaccSplitGetAction (const Split *split)
|
||||
Split *
|
||||
xaccSplitGetOtherSplit (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_other_split();
|
||||
else
|
||||
return nullptr;
|
||||
@ -156,8 +156,8 @@ xaccSplitGetOtherSplit (const Split *split)
|
||||
Transaction *
|
||||
xaccSplitGetParent (const Split *split)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
if (GNC_IS_MOCK_SPLIT(split))
|
||||
EXPECT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
if (GNC_IS_MOCKSPLIT(split))
|
||||
return ((MockSplit*)split)->get_parent();
|
||||
else
|
||||
return nullptr;
|
||||
@ -166,7 +166,7 @@ xaccSplitGetParent (const Split *split)
|
||||
void
|
||||
xaccSplitSetParent(Split *split, Transaction *trans)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_SPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKSPLIT(split));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockSplit*)split)->set_parent(trans);
|
||||
}
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "gmock-gobject.h"
|
||||
|
||||
|
||||
GType gnc_mock_split_get_type(void);
|
||||
GType gnc_mocksplit_get_type(void);
|
||||
|
||||
#define GNC_TYPE_MOCK_SPLIT (gnc_mock_split_get_type ())
|
||||
#define GNC_IS_MOCK_SPLIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCK_SPLIT))
|
||||
#define GNC_TYPE_MOCKSPLIT (gnc_mocksplit_get_type ())
|
||||
#define GNC_IS_MOCKSPLIT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCKSPLIT))
|
||||
|
||||
|
||||
// mock up for Split
|
||||
@ -46,7 +46,7 @@ public:
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return mock_g_object_new (GNC_TYPE_MOCK_SPLIT, NULL, size);
|
||||
return mock_g_object_new (GNC_TYPE_MOCKSPLIT, NULL, size);
|
||||
}
|
||||
|
||||
// define separate free() function since destructor is protected
|
||||
|
@ -10,16 +10,16 @@ struct _MockTransactionClass
|
||||
};
|
||||
typedef struct _MockTransactionClass MockTransactionClass;
|
||||
|
||||
G_DEFINE_TYPE(MockTransaction, gnc_mock_transaction, QOF_TYPE_INSTANCE);
|
||||
G_DEFINE_TYPE(MockTransaction, gnc_mocktransaction, QOF_TYPE_INSTANCE);
|
||||
|
||||
static void
|
||||
gnc_mock_transaction_init (MockTransaction *inst)
|
||||
gnc_mocktransaction_init (MockTransaction *inst)
|
||||
{
|
||||
// function is unused, initialization is done in the MockTransaction's C++ constructor
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_mock_transaction_class_init(MockTransactionClass *klass)
|
||||
gnc_mocktransaction_class_init(MockTransactionClass *klass)
|
||||
{
|
||||
// function is unused, class functions are defined in C++ code
|
||||
}
|
||||
@ -28,22 +28,22 @@ gnc_mock_transaction_class_init(MockTransactionClass *klass)
|
||||
void
|
||||
xaccTransBeginEdit (Transaction *trans)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->begin_edit();
|
||||
}
|
||||
|
||||
void
|
||||
xaccTransCommitEdit (Transaction *trans)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->commit_edit();
|
||||
}
|
||||
|
||||
Split *
|
||||
xaccTransGetSplit (const Transaction *trans, int i)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_split(i);
|
||||
else
|
||||
return nullptr;
|
||||
@ -52,9 +52,9 @@ xaccTransGetSplit (const Transaction *trans, int i)
|
||||
Split *
|
||||
xaccTransFindSplitByAccount(const Transaction *trans, const Account *acc)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
EXPECT_TRUE(GNC_IS_MOCK_ACCOUNT(acc));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
EXPECT_TRUE(GNC_IS_MOCKACCOUNT(acc));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->find_split_by_account(acc);
|
||||
else
|
||||
return nullptr;
|
||||
@ -63,8 +63,8 @@ xaccTransFindSplitByAccount(const Transaction *trans, const Account *acc)
|
||||
time64
|
||||
xaccTransGetDate (const Transaction *trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_date();
|
||||
else
|
||||
return 0;
|
||||
@ -73,15 +73,15 @@ xaccTransGetDate (const Transaction *trans)
|
||||
void
|
||||
xaccTransSetDatePostedSecsNormalized (Transaction *trans, time64 time)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->set_date_posted_secs_normalized(time);
|
||||
}
|
||||
|
||||
const char *
|
||||
xaccTransGetDescription (const Transaction *trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_description();
|
||||
else
|
||||
return nullptr;
|
||||
@ -90,15 +90,15 @@ xaccTransGetDescription (const Transaction *trans)
|
||||
void
|
||||
xaccTransSetDescription (Transaction *trans, const char *desc)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->set_description(desc);
|
||||
}
|
||||
|
||||
const char *
|
||||
xaccTransGetNotes (const Transaction *trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_notes();
|
||||
else
|
||||
return nullptr;
|
||||
@ -107,15 +107,15 @@ xaccTransGetNotes (const Transaction *trans)
|
||||
void
|
||||
xaccTransSetNotes (Transaction *trans, const char *notes)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->set_description(notes);
|
||||
}
|
||||
|
||||
gnc_numeric
|
||||
xaccTransGetImbalanceValue (const Transaction * trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_imbalance_value();
|
||||
else
|
||||
return gnc_numeric_zero();
|
||||
@ -124,8 +124,8 @@ xaccTransGetImbalanceValue (const Transaction * trans)
|
||||
const char *
|
||||
xaccTransGetNum (const Transaction *trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->get_num();
|
||||
else
|
||||
return nullptr;
|
||||
@ -134,8 +134,8 @@ xaccTransGetNum (const Transaction *trans)
|
||||
gboolean
|
||||
xaccTransIsOpen (const Transaction *trans)
|
||||
{
|
||||
EXPECT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
if (GNC_IS_MOCK_TRANSACTION(trans))
|
||||
EXPECT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
if (GNC_IS_MOCKTRANSACTION(trans))
|
||||
return ((MockTransaction*)trans)->is_open();
|
||||
else
|
||||
return FALSE;
|
||||
@ -144,6 +144,6 @@ xaccTransIsOpen (const Transaction *trans)
|
||||
void
|
||||
xaccTransDestroy (Transaction *trans)
|
||||
{
|
||||
ASSERT_TRUE(GNC_IS_MOCK_TRANSACTION(trans));
|
||||
ASSERT_TRUE(GNC_IS_MOCKTRANSACTION(trans));
|
||||
((MockTransaction*)trans)->destroy();
|
||||
}
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "gmock-gobject.h"
|
||||
|
||||
|
||||
GType gnc_mock_transaction_get_type(void);
|
||||
GType gnc_mocktransaction_get_type(void);
|
||||
|
||||
#define GNC_TYPE_MOCK_TRANSACTION (gnc_mock_transaction_get_type ())
|
||||
#define GNC_IS_MOCK_TRANSACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCK_TRANSACTION))
|
||||
#define GNC_TYPE_MOCKTRANSACTION (gnc_mocktransaction_get_type ())
|
||||
#define GNC_IS_MOCKTRANSACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MOCKTRANSACTION))
|
||||
|
||||
|
||||
// mock up for Transaction
|
||||
@ -36,7 +36,7 @@ public:
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return mock_g_object_new (GNC_TYPE_MOCK_TRANSACTION, NULL, size);
|
||||
return mock_g_object_new (GNC_TYPE_MOCKTRANSACTION, NULL, size);
|
||||
}
|
||||
|
||||
// define separate free() function since destructor is protected
|
||||
|
@ -6,16 +6,16 @@ struct _QofMockBookClass
|
||||
};
|
||||
typedef struct _QofMockBookClass QofMockBookClass;
|
||||
|
||||
G_DEFINE_TYPE(QofMockBook, qof_mock_book, QOF_TYPE_INSTANCE);
|
||||
G_DEFINE_TYPE(QofMockBook, qof_mockbook, QOF_TYPE_INSTANCE);
|
||||
|
||||
static void
|
||||
qof_mock_book_init (QofMockBook *inst)
|
||||
qof_mockbook_init (QofMockBook *inst)
|
||||
{
|
||||
// function is unused, initialization is done in the QofMockBook's C++ constructor
|
||||
}
|
||||
|
||||
static void
|
||||
qof_mock_book_class_init(QofMockBookClass *klass)
|
||||
qof_mockbook_class_init(QofMockBookClass *klass)
|
||||
{
|
||||
// function is unused, class functions are defined in C++ code
|
||||
}
|
||||
@ -23,7 +23,7 @@ qof_mock_book_class_init(QofMockBookClass *klass)
|
||||
gboolean
|
||||
qof_book_use_split_action_for_num_field (const QofBook *book)
|
||||
{
|
||||
g_return_val_if_fail(QOF_IS_MOCK_BOOK(book), FALSE);
|
||||
g_return_val_if_fail(QOF_IS_MOCKBOOK(book), FALSE);
|
||||
return ((QofMockBook*)book)->use_split_action_for_num_field();
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "gmock-Split.h"
|
||||
|
||||
|
||||
GType qof_mock_book_get_type(void);
|
||||
GType qof_mockbook_get_type(void);
|
||||
|
||||
#define QOF_TYPE_MOCK_BOOK (qof_mock_book_get_type ())
|
||||
#define QOF_IS_MOCK_BOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), QOF_TYPE_MOCK_BOOK))
|
||||
#define QOF_TYPE_MOCKBOOK (qof_mockbook_get_type ())
|
||||
#define QOF_IS_MOCKBOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), QOF_TYPE_MOCKBOOK))
|
||||
|
||||
|
||||
// mock up for QofBook
|
||||
@ -37,7 +37,7 @@ public:
|
||||
}
|
||||
void* operator new(size_t size)
|
||||
{
|
||||
return mock_g_object_new (QOF_TYPE_MOCK_BOOK, NULL, size);
|
||||
return mock_g_object_new (QOF_TYPE_MOCKBOOK, NULL, size);
|
||||
}
|
||||
|
||||
// define separate free() function since destructor is protected
|
||||
|
Loading…
Reference in New Issue
Block a user