1111
1212#include <crm/common/unittest_internal.h>
1313
14- static pcmk__output_t *
15- null_create_fn (char * * argv )
16- {
17- return NULL ;
18- }
19-
20- static pcmk__output_t *
21- null_create_fn_2 (char * * argv )
22- {
23- return NULL ;
24- }
25-
2614static void
2715no_formats (void * * state )
2816{
@@ -37,7 +25,7 @@ invalid_entries(void **state)
3725 * the marker for the end of the format table.
3826 */
3927 pcmk__supported_format_t formats [] = {
40- { "" , null_create_fn , NULL },
28+ { "" , pcmk__output_null_create1 , NULL },
4129 { NULL },
4230 };
4331
@@ -50,17 +38,19 @@ valid_entries(void **state)
5038 GHashTable * formatters = NULL ;
5139
5240 pcmk__supported_format_t formats [] = {
53- { "fmt1" , null_create_fn , NULL },
54- { "fmt2" , null_create_fn_2 , NULL },
41+ { "fmt1" , pcmk__output_null_create1 , NULL },
42+ { "fmt2" , pcmk__output_null_create2 , NULL },
5543 { NULL },
5644 };
5745
5846 pcmk__register_formats (NULL , formats );
5947
6048 formatters = pcmk__output_formatters ();
6149 assert_int_equal (g_hash_table_size (formatters ), 2 );
62- assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ), null_create_fn );
63- assert_ptr_equal (g_hash_table_lookup (formatters , "fmt2" ), null_create_fn_2 );
50+ assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ),
51+ pcmk__output_null_create1 );
52+ assert_ptr_equal (g_hash_table_lookup (formatters , "fmt2" ),
53+ pcmk__output_null_create2 );
6454
6555 pcmk__unregister_formats ();
6656}
@@ -71,16 +61,17 @@ duplicate_keys(void **state)
7161 GHashTable * formatters = NULL ;
7262
7363 pcmk__supported_format_t formats [] = {
74- { "fmt1" , null_create_fn , NULL },
75- { "fmt1" , null_create_fn_2 , NULL },
64+ { "fmt1" , pcmk__output_null_create1 , NULL },
65+ { "fmt1" , pcmk__output_null_create2 , NULL },
7666 { NULL },
7767 };
7868
7969 pcmk__register_formats (NULL , formats );
8070
8171 formatters = pcmk__output_formatters ();
8272 assert_int_equal (g_hash_table_size (formatters ), 1 );
83- assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ), null_create_fn_2 );
73+ assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ),
74+ pcmk__output_null_create2 );
8475
8576 pcmk__unregister_formats ();
8677}
@@ -91,17 +82,19 @@ duplicate_values(void **state)
9182 GHashTable * formatters = NULL ;
9283
9384 pcmk__supported_format_t formats [] = {
94- { "fmt1" , null_create_fn , NULL },
95- { "fmt2" , null_create_fn , NULL },
85+ { "fmt1" , pcmk__output_null_create1 , NULL },
86+ { "fmt2" , pcmk__output_null_create1 , NULL },
9687 { NULL },
9788 };
9889
9990 pcmk__register_formats (NULL , formats );
10091
10192 formatters = pcmk__output_formatters ();
10293 assert_int_equal (g_hash_table_size (formatters ), 2 );
103- assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ), null_create_fn );
104- assert_ptr_equal (g_hash_table_lookup (formatters , "fmt2" ), null_create_fn );
94+ assert_ptr_equal (g_hash_table_lookup (formatters , "fmt1" ),
95+ pcmk__output_null_create1 );
96+ assert_ptr_equal (g_hash_table_lookup (formatters , "fmt2" ),
97+ pcmk__output_null_create1 );
10598
10699 pcmk__unregister_formats ();
107100}
0 commit comments