|
Squid Web Cache master
|
Go to the source code of this file.
Classes | |
| class | TestMath |
| class | SuccessSumTester< S > |
| class | OverflowSumTester< S > |
Functions | |
| CPPUNIT_TEST_SUITE_REGISTRATION (TestMath) | |
| template<typename S > | |
| static S | RawSum () |
| ends argument recursion for RawSum() with parameters | |
| template<typename S , typename A , typename... Args> | |
| static S | RawSum (A a, Args... args) |
| template<typename S , template< typename > class Tester, typename A , typename B > | |
| static void | TestWithZeros (const A a, const B b) |
| checks that the summation outcome is unaffected by (not) adding zeros | |
| template<typename S , template< typename > class Tester, typename A , typename B > | |
| static void | TestOrder (const A a, const B b) |
| checks that the summation outcome is unaffected by the order of operands | |
| template<typename A , typename B > | |
| static void | TestOverflowForEitherSummationType (const A a, const B b) |
| checks that a+b and similar sums overflow for summation types A and B | |
| template<typename A , typename B > | |
| static void | TestSuccessForFirstSummationType (const A a, const B b) |
| template<typename A , typename... Args, typename S = A> | |
| static S | GoodSum (const A a, Args... args) |
| int | main (int argc, char *argv[]) |
| template<typename A > | |
| static std::string | TypeToString () |
| template<typename A > | |
| static std::string | OperandToString (const A a) |
| template<typename S , typename A , typename B > | |
| static std::string | SumToString (const A a, const B b) |
| template<typename S , typename A , typename B , typename C > | |
| static std::string | SumToString (const A a, const B b, const C c) |
Variables | |
| static const auto | min64s = std::numeric_limits<int64_t>::min() |
| static const auto | min8s = std::numeric_limits<int8_t>::min() |
| static const auto | zero8s = int8_t(0) |
| static const auto | zero8u = uint8_t(0) |
| static const auto | zero64s = int64_t(0) |
| static const auto | zero64u = uint64_t(0) |
| static const auto | one8s = int8_t(1) |
| static const auto | one8u = uint8_t(1) |
| static const auto | one64s = int64_t(1) |
| static const auto | one64u = uint64_t(1) |
| static const auto | max8s = std::numeric_limits<int8_t>::max() |
| static const auto | max8u = std::numeric_limits<uint8_t>::max() |
| static const auto | max64s = std::numeric_limits<int64_t>::max() |
| static const auto | max64u = std::numeric_limits<uint64_t>::max() |
| CPPUNIT_TEST_SUITE_REGISTRATION | ( | TestMath | ) |
|
static |
Definition at line 190 of file testMath.cc.
References SuccessSumTester< S >::Test().
Referenced by TestMath::testNaturalSum().
Definition at line 269 of file testMath.cc.
References TestProgram::run().
|
static |
Definition at line 57 of file testMath.cc.
Referenced by SumToString(), SumToString(), and SuccessSumTester< S >::Test().
|
static |
Definition at line 81 of file testMath.cc.
|
static |
helper function to add up an arbitrary number of arbitrary-type integers while converting every number to type S and ignoring any under/overflows
Definition at line 90 of file testMath.cc.
|
static |
Definition at line 64 of file testMath.cc.
References OperandToString().
|
static |
Definition at line 71 of file testMath.cc.
References OperandToString().
|
static |
Definition at line 162 of file testMath.cc.
|
static |
Definition at line 171 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
checks that a+b and similar sums succeed for summation type A but overflow for summation type B
Definition at line 181 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
|
static |
helper functions to convert NaturalSum<S>(a,b,...) calls to strings
Definition at line 49 of file testMath.cc.
|
static |
Definition at line 40 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 41 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 38 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 39 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
bit-width-specific integers, for developer convenience and code readability
Definition at line 28 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 29 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 36 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 37 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 34 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 35 of file testMath.cc.
Referenced by TestMath::testNaturalSum().
|
static |
Definition at line 32 of file testMath.cc.
Referenced by TestMath::testNaturalSum(), and TestWithZeros().
|
static |
Definition at line 33 of file testMath.cc.
Referenced by TestMath::testNaturalSum(), and TestWithZeros().
|
static |
Definition at line 30 of file testMath.cc.
Referenced by TestMath::testNaturalSum(), and TestWithZeros().
|
static |
Definition at line 31 of file testMath.cc.
Referenced by TestMath::testNaturalSum(), and TestWithZeros().