summaryrefslogtreecommitdiff
path: root/zephyr/test/math/src/mask.c
blob: 5e690c96534e6340f70fd9e042051b0a4c8b7a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright 2022 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <inttypes.h>
#include <zephyr/ztest.h>

#include "math.h"
#include "math_util.h"

ZTEST_USER(math, bitmask_uint64)
{
	zassert_equal(bitmask_uint64(-1), 0, NULL);
	zassert_equal(bitmask_uint64(64), 0, NULL);
	zassert_equal(bitmask_uint64(1), UINT64_C(1) << 1, NULL);
	zassert_equal(bitmask_uint64(15), UINT64_C(1) << 15, NULL);
	zassert_equal(bitmask_uint64(35), UINT64_C(1) << 35, NULL);
	zassert_equal(bitmask_uint64(60), UINT64_C(1) << 60, NULL);
}