Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F4638597
pcmk_readable_score_test.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
951 B
Referenced Files
None
Subscribers
None
pcmk_readable_score_test.c
View Options
/*
* Copyright 2022 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
* This source code is licensed under the GNU General Public License version 2
* or later (GPLv2+) WITHOUT ANY WARRANTY.
*/
#include <crm_internal.h>
#include <crm/common/unittest_internal.h>
static void
outside_limits(void **state)
{
assert_string_equal(pcmk_readable_score(CRM_SCORE_INFINITY * 2),
CRM_INFINITY_S);
assert_string_equal(pcmk_readable_score(-CRM_SCORE_INFINITY * 2),
CRM_MINUS_INFINITY_S);
}
static void
inside_limits(void **state)
{
assert_string_equal(pcmk_readable_score(0), "0");
assert_string_equal(pcmk_readable_score(1024), "1024");
assert_string_equal(pcmk_readable_score(-1024), "-1024");
}
PCMK__UNIT_TEST(NULL, NULL,
cmocka_unit_test(outside_limits),
cmocka_unit_test(inside_limits))
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Thu, Jul 10, 1:04 AM (11 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2009396
Default Alt Text
pcmk_readable_score_test.c (951 B)
Attached To
Mode
rP Pacemaker
Attached
Detach File
Event Timeline
Log In to Comment