Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
21
thirdparty/uint256_t/tests/testcases/accessors.cpp
vendored
Normal file
21
thirdparty/uint256_t/tests/testcases/accessors.cpp
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
#include "uint256_t.h"
|
||||
|
||||
TEST(Accessor, bits){
|
||||
uint256_t value = 1;
|
||||
for(uint32_t i = 0; i < 127; i++){
|
||||
EXPECT_EQ(value.bits(), i + 1); // before shift
|
||||
value <<= 1;
|
||||
}
|
||||
|
||||
EXPECT_EQ(uint256_t(0).bits(), 0);
|
||||
}
|
||||
|
||||
TEST(Accessor, data){
|
||||
const uint256_t value(0xfedcba9876543210ULL, 0x0123456789abcdefULL, 0xfedcba9876543210ULL, 0x0123456789abcdefULL);
|
||||
EXPECT_EQ(value.upper().upper(), 0xfedcba9876543210ULL);
|
||||
EXPECT_EQ(value.upper().lower(), 0x0123456789abcdefULL);
|
||||
EXPECT_EQ(value.lower().upper(), 0xfedcba9876543210ULL);
|
||||
EXPECT_EQ(value.lower().lower(), 0x0123456789abcdefULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue