|
webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
#include <stddef.h>#include <stdint.h>#include <limits>#include <type_traits>#include "base/compiler_specific.h"#include "base/numerics/safe_conversions.h"#include "base/numerics/safe_math.h"#include "build/build_config.h"#include "testing/gtest/include/gtest/gtest.h"Macros | |
| #define | TEST_EXPECTED_VALIDITY(expected, actual) |
| #define | TEST_EXPECTED_SUCCESS(actual) TEST_EXPECTED_VALIDITY(true, actual) |
| #define | TEST_EXPECTED_FAILURE(actual) TEST_EXPECTED_VALIDITY(false, actual) |
| #define | TEST_EXPECTED_VALUE(expected, actual) |
| #define | TEST_ARITHMETIC(Dst) TestArithmetic<Dst>(#Dst, __LINE__) |
| #define | TEST_EXPECTED_RANGE(expected, actual) |
| #define | TEST_NUMERIC_CONVERSION(d, s, t) TestNumericConversion<d, s, t>::Test(#d, #s, __LINE__) |
Enumerations | |
| enum | NumericConversionType { SIGN_PRESERVING_VALUE_PRESERVING, SIGN_PRESERVING_NARROW, SIGN_TO_UNSIGN_WIDEN_OR_EQUAL, SIGN_TO_UNSIGN_NARROW, UNSIGN_TO_SIGN_NARROW_OR_EQUAL } |
Functions | |
| template<typename Dst , typename Src > | |
| Dst | GetMaxConvertibleToFloat () |
| template<typename Dst > | |
| void | TestSpecializedArithmetic (const char *dst, int line, typename std::enable_if< numeric_limits< Dst >::is_iec559, int >::type=0) |
| TEST (SafeNumerics, SignedIntegerMath) | |
| TEST (SafeNumerics, UnsignedIntegerMath) | |
| TEST (SafeNumerics, FloatingPointMath) | |
| TEST (SafeNumerics, IntMinOperations) | |
| TEST (SafeNumerics, IntOperations) | |
| TEST (SafeNumerics, IntMaxOperations) | |
| TEST (SafeNumerics, FloatOperations) | |
| TEST (SafeNumerics, DoubleOperations) | |
| TEST (SafeNumerics, SizeTOperations) | |
| TEST (SafeNumerics, CastTests) | |
| TEST (SafeNumerics, IsValueInRangeForNumericType) | |
| TEST (SafeNumerics, CompoundNumericOperations) | |
| #define TEST_ARITHMETIC | ( | Dst | ) | TestArithmetic<Dst>(#Dst, __LINE__) |
| #define TEST_EXPECTED_FAILURE | ( | actual | ) | TEST_EXPECTED_VALIDITY(false, actual) |
| #define TEST_EXPECTED_RANGE | ( | expected, | |
| actual | |||
| ) |
| #define TEST_EXPECTED_SUCCESS | ( | actual | ) | TEST_EXPECTED_VALIDITY(true, actual) |
| #define TEST_EXPECTED_VALIDITY | ( | expected, | |
| actual | |||
| ) |
| #define TEST_EXPECTED_VALUE | ( | expected, | |
| actual | |||
| ) |
| Dst GetMaxConvertibleToFloat | ( | ) |
| TEST | ( | SafeNumerics | , |
| SignedIntegerMath | |||
| ) |
| TEST | ( | SafeNumerics | , |
| UnsignedIntegerMath | |||
| ) |
| TEST | ( | SafeNumerics | , |
| FloatingPointMath | |||
| ) |
| TEST | ( | SafeNumerics | , |
| IntMinOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| IntOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| IntMaxOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| FloatOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| DoubleOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| SizeTOperations | |||
| ) |
| TEST | ( | SafeNumerics | , |
| CastTests | |||
| ) |
| TEST | ( | SafeNumerics | , |
| IsValueInRangeForNumericType | |||
| ) |
| TEST | ( | SafeNumerics | , |
| CompoundNumericOperations | |||
| ) |
1.8.13