pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
crm_md5sum_test.c
Go to the documentation of this file.
1 /*
2  * Copyright 2024 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU General Public License version 2
7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <crm_internal.h>
11 
13 
14 static void
15 null_arg_test(void **state)
16 {
17  assert_null(crm_md5sum(NULL));
18 }
19 
20 static void
21 basic_usage_test(void **state)
22 {
23  char *result = crm_md5sum("abcdefghijklmnopqrstuvwxyz");
24 
25  assert_string_equal(result, "c3fcd3d76192e4007dfb496cca67e13b");
26  free(result);
27 }
28 
29 PCMK__UNIT_TEST(NULL, NULL,
30  cmocka_unit_test(null_arg_test),
31  cmocka_unit_test(basic_usage_test))
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
pcmk__action_result_t result
Definition: pcmk_fence.c:37
char * crm_md5sum(const char *buffer)
Definition: digest.c:251