proxygen
|
#include <folly/ConstexprMath.h>
#include <limits>
#include <type_traits>
#include <folly/lang/Bits.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Functions | |
TEST_F (ConstexprMathTest, constexpr_min) | |
TEST_F (ConstexprMathTest, constexpr_max) | |
TEST_F (ConstexprMathTest, constexpr_clamp) | |
TEST_F (ConstexprMathTest, constexpr_abs_unsigned) | |
TEST_F (ConstexprMathTest, constexpr_abs_signed_positive) | |
TEST_F (ConstexprMathTest, constexpr_abs_signed_negative) | |
TEST_F (ConstexprMathTest, constexpr_abs_float_positive) | |
TEST_F (ConstexprMathTest, constexpr_abs_float_negative) | |
TEST_F (ConstexprMathTest, constexpr_abs_double_positive) | |
TEST_F (ConstexprMathTest, constexpr_abs_double_negative) | |
TEST_F (ConstexprMathTest, constexpr_log2_1) | |
TEST_F (ConstexprMathTest, constexpr_log2_2) | |
TEST_F (ConstexprMathTest, constexpr_log2_64) | |
TEST_F (ConstexprMathTest, constexpr_log2_ceil_1) | |
TEST_F (ConstexprMathTest, constexpr_log2_ceil_2) | |
TEST_F (ConstexprMathTest, constexpr_log2_ceil_3) | |
TEST_F (ConstexprMathTest, constexpr_log2_ceil_63) | |
TEST_F (ConstexprMathTest, constexpr_log2_ceil_64) | |
TEST_F (ConstexprMathTest, constexpr_ceil) | |
TEST_F (ConstexprMathTest, constexpr_pow) | |
TEST_F (ConstexprMathTest, constexpr_find_last_set_examples) | |
TEST_F (ConstexprMathTest, constexpr_find_last_set_all_64_adjacents) | |
TEST_F (ConstexprMathTest, constexpr_find_last_set_all_8_reference) | |
TEST_F (ConstexprMathTest, constexpr_find_first_set_examples) | |
TEST_F (ConstexprMathTest, constexpr_find_first_set_all_64_adjacent) | |
TEST_F (ConstexprMathTest, constexpr_find_first_set_all_8_reference) | |
TEST_F (ConstexprMathTest, constexpr_add_overflow_clamped) | |
TEST_F (ConstexprMathTest, constexpr_sub_overflow_clamped) | |
template<class F , class... Args> | |
void | for_each_argument (F &&f, Args &&...args) |
template<typename Src , typename Dst > | |
static std::enable_if< std::is_floating_point< Src >::value, void >::type | run_constexpr_clamp_cast_test (Src, Dst) |
template<typename Src , typename Dst > | |
static std::enable_if< std::is_integral< Src >::value, void >::type | run_constexpr_clamp_cast_test (Src, Dst) |
TEST_F (ConstexprMathTest, constexpr_clamp_cast) | |
Variables | |
constexpr auto | kInt64Max = std::numeric_limits<int64_t>::max() |
constexpr auto | kInt64Min = std::numeric_limits<int64_t>::min() |
constexpr auto | kUInt64Max = std::numeric_limits<uint64_t>::max() |
constexpr auto | kInt8Max = std::numeric_limits<int8_t>::max() |
constexpr auto | kInt8Min = std::numeric_limits<int8_t>::min() |
constexpr auto | kUInt8Max = std::numeric_limits<uint8_t>::max() |
void for_each_argument | ( | F && | f, |
Args &&... | args | ||
) |
|
static |
Definition at line 382 of file ConstexprMathTest.cpp.
References EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, max, min, type, and value.
Referenced by TEST_F().
|
static |
TEST_F | ( | ConstexprMathTest | , |
constexpr_min | |||
) |
Definition at line 29 of file ConstexprMathTest.cpp.
References a, folly::constexpr_min(), EXPECT_EQ, EXPECT_TRUE, uint16_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_max | |||
) |
Definition at line 38 of file ConstexprMathTest.cpp.
References a, folly::constexpr_max(), EXPECT_EQ, EXPECT_TRUE, uint16_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_clamp | |||
) |
Definition at line 47 of file ConstexprMathTest.cpp.
References folly::constexpr_clamp(), EXPECT_EQ, EXPECT_TRUE, uint16_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_unsigned | |||
) |
Definition at line 59 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, uint32_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_signed_positive | |||
) |
Definition at line 66 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, int32_t, uint32_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_signed_negative | |||
) |
Definition at line 73 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, int32_t, uint32_t, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_float_positive | |||
) |
Definition at line 80 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_float_negative | |||
) |
Definition at line 87 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_double_positive | |||
) |
Definition at line 94 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_abs_double_negative | |||
) |
Definition at line 101 of file ConstexprMathTest.cpp.
References a, folly::constexpr_abs(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_1 | |||
) |
Definition at line 108 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_2 | |||
) |
Definition at line 115 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_64 | |||
) |
Definition at line 122 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_ceil_1 | |||
) |
Definition at line 129 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2_ceil(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_ceil_2 | |||
) |
Definition at line 136 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2_ceil(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_ceil_3 | |||
) |
Definition at line 143 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2_ceil(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_ceil_63 | |||
) |
Definition at line 150 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2_ceil(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_log2_ceil_64 | |||
) |
Definition at line 157 of file ConstexprMathTest.cpp.
References a, folly::constexpr_log2_ceil(), EXPECT_EQ, EXPECT_TRUE, and value.
TEST_F | ( | ConstexprMathTest | , |
constexpr_ceil | |||
) |
Definition at line 164 of file ConstexprMathTest.cpp.
References folly::constexpr_ceil(), EXPECT_EQ, and folly::chrono::round().
TEST_F | ( | ConstexprMathTest | , |
constexpr_pow | |||
) |
Definition at line 185 of file ConstexprMathTest.cpp.
References a, folly::constexpr_pow(), EXPECT_EQ, and uint64_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_last_set_examples | |||
) |
Definition at line 200 of file ConstexprMathTest.cpp.
References a, folly::constexpr_find_last_set(), EXPECT_EQ, and int64_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_last_set_all_64_adjacents | |||
) |
Definition at line 215 of file ConstexprMathTest.cpp.
References folly::constexpr_find_last_set(), EXPECT_EQ, i, type, and uint64_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_last_set_all_8_reference | |||
) |
Definition at line 226 of file ConstexprMathTest.cpp.
References folly::constexpr_find_last_set(), EXPECT_EQ, folly::findLastSet(), i, and type.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_first_set_examples | |||
) |
Definition at line 234 of file ConstexprMathTest.cpp.
References a, folly::constexpr_find_first_set(), EXPECT_EQ, and int64_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_first_set_all_64_adjacent | |||
) |
Definition at line 249 of file ConstexprMathTest.cpp.
References folly::constexpr_find_first_set(), EXPECT_EQ, i, type, and uint64_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_find_first_set_all_8_reference | |||
) |
Definition at line 259 of file ConstexprMathTest.cpp.
References folly::constexpr_find_first_set(), EXPECT_EQ, folly::findFirstSet(), i, and type.
TEST_F | ( | ConstexprMathTest | , |
constexpr_add_overflow_clamped | |||
) |
Definition at line 274 of file ConstexprMathTest.cpp.
References a, ASSERT_EQ, ASSERT_GE, ASSERT_LE, b, c, folly::constexpr_add_overflow_clamped(), folly::constexpr_clamp(), EXPECT_EQ, int64_t, int8_t, kInt64Max, kInt8Max, kInt8Min, kUInt64Max, kUInt8Max, uint64_t, and uint8_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_sub_overflow_clamped | |||
) |
Definition at line 320 of file ConstexprMathTest.cpp.
References a, testing::Args(), ASSERT_EQ, ASSERT_GE, ASSERT_LE, b, c, folly::constexpr_clamp(), folly::constexpr_sub_overflow_clamped(), EXPECT_EQ, int64_t, int8_t, kInt64Max, kInt64Min, kInt8Max, kInt8Min, kUInt8Max, uint64_t, and uint8_t.
TEST_F | ( | ConstexprMathTest | , |
constexpr_clamp_cast | |||
) |
Definition at line 450 of file ConstexprMathTest.cpp.
References for_each_argument(), int16_t, int32_t, int64_t, int8_t, run_constexpr_clamp_cast_test(), uint16_t, uint32_t, uint64_t, and uint8_t.
Definition at line 267 of file ConstexprMathTest.cpp.
Referenced by TEST_F().
Definition at line 268 of file ConstexprMathTest.cpp.
Referenced by TEST_F().
Definition at line 270 of file ConstexprMathTest.cpp.
Referenced by TEST_F().
Definition at line 271 of file ConstexprMathTest.cpp.
Referenced by TEST_F().
Definition at line 269 of file ConstexprMathTest.cpp.
Referenced by TEST_F().
Definition at line 272 of file ConstexprMathTest.cpp.
Referenced by TEST_F().