root/lib/common/tests/digest/crm_md5sum_test.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. null_arg_test
  2. basic_usage_test

   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 
  12 #include <crm/common/unittest_internal.h>
  13 
  14 static void
  15 null_arg_test(void **state)
     /* [previous][next][first][last][top][bottom][index][help] */
  16 {
  17     assert_null(crm_md5sum(NULL));
  18 }
  19 
  20 static void
  21 basic_usage_test(void **state)
     /* [previous][next][first][last][top][bottom][index][help] */
  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))

/* [previous][next][first][last][top][bottom][index][help] */