root/lib/common/tests/flags/pcmk_any_flags_set_test.c

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

DEFINITIONS

This source file includes following definitions.
  1. any_set
  2. main

   1 /*
   2  * Copyright 2020 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 Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #include <stdio.h>
  11 #include <stdbool.h>
  12 #include <crm_internal.h>
  13 
  14 static void
  15 any_set(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  16     g_assert_cmpint(pcmk_any_flags_set(0x000, 0x000), ==, false);
  17     g_assert_cmpint(pcmk_any_flags_set(0x000, 0x001), ==, false);
  18     g_assert_cmpint(pcmk_any_flags_set(0x00f, 0x001), ==, true);
  19     g_assert_cmpint(pcmk_any_flags_set(0x00f, 0x010), ==, false);
  20     g_assert_cmpint(pcmk_any_flags_set(0x00f, 0x011), ==, true);
  21     g_assert_cmpint(pcmk_any_flags_set(0x000, 0x000), ==, false);
  22     g_assert_cmpint(pcmk_any_flags_set(0x00f, 0x000), ==, false);
  23 }
  24 
  25 int
  26 main(int argc, char **argv)
     /* [previous][next][first][last][top][bottom][index][help] */
  27 {
  28     g_test_init(&argc, &argv, NULL);
  29 
  30     g_test_add_func("/common/flags/any_set/any_set", any_set);
  31     return g_test_run();
  32 }

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