Searched refs:CheckedInt (Results 1 – 2 of 2) sorted by relevance
25 using detail::CheckedInt;51 EXPECT_EQ(CheckedInt::from(Min).template to<T>(), Min); in TYPED_TEST()52 EXPECT_EQ(CheckedInt::from(Max).template to<T>(), Max); in TYPED_TEST()56 const CheckedInt Actual = CheckedInt::from(Expected); in TYPED_TEST()79 EXPECT_DEATH(CheckedInt::from(-1).to<uint8_t>(), "Out of bounds"); in TEST()80 EXPECT_DEATH(CheckedInt::from(256).to<uint8_t>(), "Out of bounds"); in TEST()82 EXPECT_DEATH(CheckedInt::from(INTMAX_MAX) + 1, "Out of bounds"); in TEST()83 EXPECT_DEATH(CheckedInt::from(INTMAX_MIN) + -1, "Out of bounds"); in TEST()84 EXPECT_DEATH(CheckedInt::from(INTMAX_MIN) - CheckedInt::from(INTMAX_MAX), in TEST()257 EXPECT_EQ(CheckedInt::from(A).to<UntypedEnum>(), A); in TEST()[all …]
127 struct CheckedInt { struct131 static CheckedInt from(Integral FromValue) { in from() argument134 CheckedInt Result; in from()142 static CheckedInt from(Enum FromValue) { in from() argument148 bool operator==(const CheckedInt &O) const { return Value == O.Value; }151 CheckedInt operator+(intmax_t Offset) const {152 CheckedInt Result; argument158 intmax_t operator-(CheckedInt Other) const {197 explicit SafeIntIterator(T Value) : SI(CheckedInt::from<T>(Value)) {} in SafeIntIterator() argument245 SafeIntIterator(const CheckedInt &SI) : SI(SI) {} in SafeIntIterator()[all …]