1#include <xrpl/basics/tagged_integer.h>
3#include <gtest/gtest.h>
25 "TagUInt1 should be constructible using a std::uint32_t");
29 "TagUInt1 should not be constructible using a std::uint64_t");
33 "TagUInt3 should be constructible using a std::uint32_t");
37 "TagUInt3 should be constructible using a std::uint64_t");
42 "TagUInt1 should not be assignable with a std::uint32_t");
46 "TagUInt1 should not be assignable with a std::uint64_t");
50 "TagUInt3 should not be assignable with a std::uint32_t");
54 "TagUInt3 should not be assignable with a std::uint64_t");
69 "std::uint32_t should not be convertible to a TagUInt1");
73 "std::uint32_t should not be convertible to a TagUInt3");
77 "std::uint64_t should not be convertible to a TagUInt3");
81 "std::uint64_t should not be convertible to a TagUInt2");
96 EXPECT_TRUE(one == one);
97 EXPECT_FALSE(one == zero);
99 EXPECT_TRUE(one != zero);
100 EXPECT_FALSE(one != one);
102 EXPECT_TRUE(zero < one);
103 EXPECT_FALSE(one < zero);
105 EXPECT_TRUE(one > zero);
106 EXPECT_FALSE(zero > one);
108 EXPECT_TRUE(one >= one);
109 EXPECT_TRUE(one >= zero);
110 EXPECT_FALSE(zero >= one);
112 EXPECT_TRUE(zero <= one);
113 EXPECT_TRUE(zero <= zero);
114 EXPECT_FALSE(one <= zero);
135 EXPECT_EQ(+a,
TagInt{-2});
172 EXPECT_EQ(a,
TagInt{-12});
A type-safe wrap around standard integral types.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.