15 #include "../../crmcommon_private.h" 38 mk_fake_text_output(
char **argv) {
46 retval->
init = fake_text_init;
62 teardown(
void **state) {
68 null_params(
void **state) {
82 add_message(
void **state) {
88 assert_int_equal(g_hash_table_size(out->
messages), 0);
92 assert_int_equal(g_hash_table_size(out->
messages), 1);
93 assert_ptr_equal(g_hash_table_lookup(out->
messages,
"fake"), null_message_fn);
99 assert_int_equal(g_hash_table_size(out->
messages), 1);
100 assert_ptr_equal(g_hash_table_lookup(out->
messages,
"fake"), null_message_fn_2);
106 cmocka_unit_test_setup_teardown(null_params, setup, teardown),
107 cmocka_unit_test_setup_teardown(add_message, setup, teardown))
int(* message)(pcmk__output_t *out, const char *message_id,...)
const char * fmt_name
The name of this output formatter.
void pcmk__register_message(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
PCMK__UNIT_TEST(NULL, NULL, cmocka_unit_test(bad_input), cmocka_unit_test(not_found), cmocka_unit_test(find_attrB), cmocka_unit_test(find_attrA_matching))
int pcmk__call_message(pcmk__output_t *out, const char *message_id,...)
GHashTable * messages
Custom messages that are currently registered on this formatter.
G_GNUC_INTERNAL int pcmk__bare_output_new(pcmk__output_t **out, const char *fmt_name, const char *filename, char **argv)
Formatted output for pacemaker tools.
void(* register_message)(pcmk__output_t *out, const char *message_id, pcmk__message_fn_t fn)
void(* free_priv)(pcmk__output_t *out)
bool(* init)(pcmk__output_t *out)
#define pcmk__assert_asserts(stmt)
int pcmk__register_format(GOptionGroup *group, const char *name, pcmk__output_factory_t create, const GOptionEntry *options)
void pcmk__output_free(pcmk__output_t *out)
void pcmk__unregister_formats(void)
This structure contains everything that makes up a single output formatter.
int pcmk__output_new(pcmk__output_t **out, const char *fmt_name, const char *filename, char **argv)