Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
get_msb.test.cpp
Go to the documentation of this file.
1#include "get_msb.hpp"
2#include <gtest/gtest.h>
3
4using namespace bb;
5
6TEST(bitop, GetMsbUint640Value)
7{
8 uint64_t a = 0b00000000000000000000000000000000;
9 EXPECT_EQ(numeric::get_msb(a), 0U);
10}
11
12TEST(bitop, GetMsbUint320)
13{
14 uint32_t a = 0b00000000000000000000000000000001;
15 EXPECT_EQ(numeric::get_msb(a), 0U);
16}
17
18TEST(bitop, GetMsbUint3231)
19{
20 uint32_t a = 0b10000000000000000000000000000001;
21 EXPECT_EQ(numeric::get_msb(a), 31U);
22}
23
24TEST(bitop, GetMsbUint6463)
25{
26 uint64_t a = 0b1000000000000000000000000000000100000000000000000000000000000000;
27 EXPECT_EQ(numeric::get_msb(a), 63U);
28}
29
30TEST(bitop, GetMsbSizeT7)
31{
32 size_t a = 0x80;
33 auto r = numeric::get_msb(a);
34 EXPECT_EQ(r, 7U);
35}
FF a
constexpr T get_msb(const T in)
Definition get_msb.hpp:47
Entry point for Barretenberg command-line interface.
TEST(MegaCircuitBuilder, CopyConstructor)