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");
58 "TagUInt1 should be assignable with a TagUInt1");
62 "TagUInt1 should not be assignable with a TagUInt2");
66 "TagUInt3 should be assignable with a TagUInt1");
70 "TagUInt1 should not be assignable with a TagUInt3");
74 "TagUInt3 should not be assignable with a TagUInt1");
79 "std::uint32_t should not be convertible to a TagUInt1");
83 "std::uint32_t should not be convertible to a TagUInt3");
87 "std::uint64_t should not be convertible to a TagUInt3");
91 "std::uint64_t should not be convertible to a TagUInt2");
95 "TagUInt1 should not be convertible to TagUInt2");
99 "TagUInt1 should not be convertible to TagUInt3");
103 "TagUInt2 should not be convertible to a TagUInt3");
112 EXPECT_TRUE(one == one);
113 EXPECT_FALSE(one == zero);
115 EXPECT_TRUE(one != zero);
116 EXPECT_FALSE(one != one);
118 EXPECT_TRUE(zero < one);
119 EXPECT_FALSE(one < zero);
121 EXPECT_TRUE(one > zero);
122 EXPECT_FALSE(zero > one);
124 EXPECT_TRUE(one >= one);
125 EXPECT_TRUE(one >= zero);
126 EXPECT_FALSE(zero >= one);
128 EXPECT_TRUE(zero <= one);
129 EXPECT_TRUE(zero <= zero);
130 EXPECT_FALSE(one <= zero);
151 EXPECT_EQ(+a,
TagInt{-2});
188 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.