28 #include <test-stuff.h>
29 #include <unittest-support.h>
30 #include "../cashobjects.h"
32 #define TEST_MODULE_NAME "TestModuleName"
33 #define TEST_CORE "TestCoreType"
34 #define TEST_PARAM "test-param"
35 #define BAD_PARAM "bad-param"
37 static int test_sort (gpointer a, gpointer b)
42 static int test_core_param (gpointer a)
47 static void test_class (
void)
51 { TEST_PARAM, TEST_CORE, (
QofAccessFunc)test_core_param, NULL },
55 gchar *msg1 =
"qof_class_get_parameter: assertion `obj_name' failed";
56 gchar *msg2 =
"qof_class_get_parameter: assertion `parameter' failed";
57 gchar *logdomain =
"qof";
58 guint loglevel = G_LOG_LEVEL_CRITICAL;
61 test_add_error (&check1);
62 test_add_error (&check2);
63 g_log_set_handler (logdomain, loglevel,
64 (GLogFunc)test_list_handler, NULL);
70 == ¶ms[0],
"qof_class_get_parameter");
72 "qof_class_get_parameter (NULL, NULL)");
74 "qof_class_get_parameter (TEST_MODULE_NAME, NULL)");
76 "qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM)");
78 "qof_class_get_parameter (NULL, TEST_PARAM)");
82 "qof_class_get_parameter_getter");
86 TEST_CORE) == 0,
"qof_class_get_parameter_type");
92 test_clear_error_list ();
95 static void test_query_core (
void)
100 static void test_querynew (
void)
105 main (
int argc,
char **argv)
108 if (cashobjects_register())
115 print_test_results();
void qof_class_register(QofIdTypeConst obj_name, QofSortFunc default_sort_fcn, const QofParam *params)
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
QofAccessFunc qof_class_get_parameter_getter(QofIdTypeConst obj_name, const char *parameter)
const QofParam * qof_class_get_parameter(QofIdTypeConst obj_name, const char *parameter)
int(* QofSortFunc)(gconstpointer, gconstpointer)
void qof_close(void)
Safely close down the Query Object Framework.
void qof_init(void)
Initialise the Query Object Framework.
QofType qof_class_get_parameter_type(QofIdTypeConst obj_name, const char *param_name)