source: mainline/uspace/lib/c/test/casting.c@ cd1e3fc0

Last change on this file since cd1e3fc0 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 643 bytes
Line 
1/*
2 * SPDX-FileCopyrightText: 2019 Vojtech Horky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <pcut/pcut.h>
8#include <limits.h>
9#include <types/casting.h>
10
11PCUT_INIT;
12
13PCUT_TEST_SUITE(casting);
14
15/*
16 * Following tests checks functionality of can_cast_size_t_to_int.
17 */
18
19PCUT_TEST(size_t_to_int_with_small)
20{
21 PCUT_ASSERT_TRUE(can_cast_size_t_to_int(0));
22 PCUT_ASSERT_TRUE(can_cast_size_t_to_int(128));
23}
24
25PCUT_TEST(size_t_to_int_with_biggest_int)
26{
27 PCUT_ASSERT_TRUE(can_cast_size_t_to_int(INT_MAX));
28}
29
30PCUT_TEST(size_t_to_int_with_biggest_size_t)
31{
32 PCUT_ASSERT_FALSE(can_cast_size_t_to_int(SIZE_MAX));
33}
34
35PCUT_EXPORT(casting);
Note: See TracBrowser for help on using the repository browser.