mirror of https://github.com/Gnucash/gnucash
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
#include <glib.h>
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wcpp"
|
|
#include <gmock/gmock.h>
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
#include <qofinstance.h>
|
|
#include <qofinstance-p.h>
|
|
|
|
|
|
G_DEFINE_TYPE(QofInstance, qof_instance, G_TYPE_OBJECT)
|
|
|
|
static void
|
|
qof_instance_init (QofInstance *inst)
|
|
{
|
|
// function is unused, initialization is done in the constructor of the derived mock class
|
|
}
|
|
|
|
static void
|
|
qof_instance_class_init(QofInstanceClass *klass)
|
|
{
|
|
// function is unused, class functions are defined in C++ code
|
|
}
|
|
|
|
// This is a reimplementation of the function from qofinstance.cpp
|
|
void
|
|
qof_instance_get (const QofInstance *inst, const gchar *first_prop, ...)
|
|
{
|
|
va_list ap;
|
|
ASSERT_TRUE (QOF_IS_INSTANCE (inst));
|
|
|
|
va_start (ap, first_prop);
|
|
g_object_get_valist (G_OBJECT (inst), first_prop, ap);
|
|
va_end (ap);
|
|
}
|
|
|
|
// This is a reimplementation of the function from qofinstance.cpp
|
|
// without calling qof_instance_set_dirty()
|
|
void
|
|
qof_instance_set (QofInstance *inst, const gchar *first_prop, ...)
|
|
{
|
|
va_list ap;
|
|
ASSERT_TRUE (QOF_IS_INSTANCE (inst));
|
|
|
|
va_start (ap, first_prop);
|
|
g_object_set_valist (G_OBJECT (inst), first_prop, ap);
|
|
va_end (ap);
|
|
}
|
|
|