libdpf/thirdparty/uint256_t/tests/testcases/unary.cpp
Ryan Henry e4e666f459 Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-24 14:08:32 -06:00

16 lines
No EOL
419 B
C++

#include <gtest/gtest.h>
#include "uint256_t.h"
TEST(Arithmetic, unary_plus){
const uint256_t value(0x12345ULL);
EXPECT_EQ(+value, value);
}
TEST(Arithmetic, unary_minus){
const uint256_t val(1);
const uint256_t neg = -val;
EXPECT_EQ(-val, neg);
EXPECT_EQ(-neg, val);
EXPECT_EQ(neg, uint256_t(0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL));
}