26 #include "qofclass-p.h" 27 #include "qofquerycore-p.h" 29 #include "test-stuff.h" 31 #define TEST_MODULE_NAME "TestModuleName" 32 #define TEST_MODULE_DESC "Test Object" 33 #define TEST_CORE "TestCoreType" 34 #define TEST_PARAM "test-param" 35 #define BAD_PARAM "bad-param" 43 do_test (col != NULL,
"foreach: NULL collection");
44 success (
"called foreach callback");
50 printable (gpointer obj)
52 do_test (obj != NULL,
"printable: object is NULL");
53 success (
"called printable callback");
54 return ((
const gchar *) obj);
59 .e_type = TEST_MODULE_NAME,
60 .type_label = TEST_MODULE_DESC,
66 .foreach = obj_foreach,
67 .printable = printable,
72 test_sort (gpointer a __attribute__ ((unused)), gpointer b __attribute__ ((unused)))
78 test_core_param (gpointer a __attribute__ ((unused)))
89 {NULL, NULL, NULL, NULL, NULL},
92 fprintf (stderr,
"\tTesting the qof_query_object interface. \n" 93 "\tYou may see some \"** CRITICAL **\" messages, which you can safely ignore\n");
99 == ¶ms[0],
"qof_class_get_parameter");
101 "qof_class_get_parameter (NULL, NULL)");
103 "qof_class_get_parameter (TEST_MODULE_NAME, NULL)");
105 "qof_class_get_parameter (TEST_MODULE_NAME, BAD_PARAM)");
107 "qof_class_get_parameter (NULL, TEST_PARAM)");
111 "qof_class_get_parameter_getter");
115 TEST_CORE) == 0,
"qof_class_get_parameter_type");
117 do_test (qof_class_get_default_sort (TEST_MODULE_NAME) ==
118 (
QofSortFunc) test_sort,
"qof_class_get_default_sort");
119 do_test (qof_class_get_default_sort (NULL) == NULL,
120 "qof_class_get_default_sort (NULL)");
124 test_query_core (
void)
141 print_test_results ();
#define QOF_OBJECT_VERSION
void qof_class_register(QofIdTypeConst obj_name, QofSortFunc default_sort_function, const QofParam *params)
registers a new object class with the Qof subsystem.
void(* QofEntityForeachCB)(QofEntity *, gpointer user_data)
gint(* QofSortFunc)(gconstpointer, gconstpointer)
struct QofCollection_s QofCollection
const QofParam * qof_class_get_parameter(QofIdTypeConst obj_name, const gchar *parameter)
gpointer(* QofAccessFunc)(gpointer object, const QofParam *param)
gboolean qof_object_register(const QofObject *object)
void qof_close(void)
Safely close down the Query Object Framework.
QofType qof_class_get_parameter_type(QofIdTypeConst obj_name, const gchar *param_name)
gint safe_strcmp(const gchar *da, const gchar *db)
QofAccessFunc qof_class_get_parameter_getter(QofIdTypeConst obj_name, const gchar *parameter)
void qof_init(void)
Initialise the Query Object Framework.