Commit Graph

25 Commits

Author SHA1 Message Date
Christian Gruber
99256c385b Add missing _get_type() functions of all mocked GObject classes
If a GObject is replaced by a mock up, its _get_type() function has to
be replaced as well. The replaced _get_type() functions have to return
the type of the mock up now.
2020-09-22 22:07:21 +02:00
Christian Gruber
833edd0b29 Add missing comment 2020-09-21 00:50:24 +02:00
Christian Gruber
bc80bbb325 Simplify type checking for GObject mockups
A type conversion function is introduced for each GObject mockup. This
function does a runtime type check and generates a GoogleTest failure in
case of any type error. This avoids checking GObject type twice.
2020-09-21 00:47:53 +02:00
Christian Gruber
b0906b5e2a Use MOCK_CONST_METHODn() macro instead of MOCK_METHODn() macro if necessary 2020-09-20 23:36:34 +02:00
Christian Gruber
5408854c28 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.
2020-09-20 22:33:51 +02:00
Christian Gruber
41c147a918 Use /* ... */ for multi-line comments 2020-08-24 23:31:08 +02:00
Christian Gruber
df6621f2b5 Add doxygen documentation to QofFakeQuery and QofFakeQueryPool 2020-08-24 23:13:23 +02:00
Christian Gruber
861a2482fe Add a comment on using empty ctor for mock classes derived from GObjects 2020-07-10 23:03:01 +02:00
Christian Gruber
3d92d53917 Rename all class methods using snake_case instead of camelCase 2020-07-09 22:03:05 +02:00
Christian Gruber
1fa90a5429 Cleanup some comments 2020-07-09 22:00:18 +02:00
Christian Gruber
1e2236afdc Use typed queries 2020-07-09 22:00:18 +02:00
Christian Gruber
fa82a8bcce Replace query factory by a query pool
Query factory was implemented using a public global variable
qof_query_factory.

Furthermore a query pool is easier to handle than a factory, since the
whole management can be hidden from the user.
2020-07-09 22:00:14 +02:00
Christian Gruber
2639cdefdf Remove unnecessary inclusion of qofquery-p.h 2020-07-09 21:58:48 +02:00
Christian Gruber
841111e37e Rename class QofMockQuery to QofFakeQuery 2020-07-09 21:58:48 +02:00
Christian Gruber
bbfc30d70b Rename gmock-qofquery to fake-qofquery 2020-07-09 21:58:48 +02:00
Christian Gruber
8ac640d5fa Fix typo 2020-06-15 22:57:13 +02:00
Christian Gruber
610bbda23f Add glib-object.h to includes 2020-06-15 22:57:13 +02:00
Christian Gruber
53c294f9e8 Remove unnecessary type check 2020-06-15 22:57:13 +02:00
Christian Gruber
bb0088c43c Replace g_return_if_fail() and g_return_val_if_fail() by ASSERT_TRUE and EXPECT_TRUE 2020-06-15 22:57:13 +02:00
Christian Gruber
967cf0b430 Pass std::vector arguments by reference instead of by value 2020-06-15 22:57:12 +02:00
Christian Gruber
d084279891 State comment on unused GObject instance init function more precisely 2020-06-15 22:57:12 +02:00
Christian Gruber
67f63053fb Remove todo comments on replacement of std::vector by std::list
Replacing std::vector by std::list wouldn't have any advantage
2020-06-15 22:57:12 +02:00
Christian Gruber
a9d85e8f8e Use std::vector of const char* instead of std::string where meaningful
This avoids additional string allocation
2020-06-15 22:57:12 +02:00
Geert Janssens
a124e647db Add files omitted in previous commit 2020-05-29 17:35:04 +02:00
John Ralls
f2a13ecac7 Merge Christian Gruber's 'test_import_backend' into master. 2020-05-21 12:39:57 -07:00