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

#include <inttypes.h>
#include <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);
}