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 ();