Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse authored and neheb committed Nov 1, 2022
1 parent 436cdf0 commit dc5dc0d
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions unitTests/test_safe_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const T AdditionTestValues<T, std::enable_if_t<!std::is_signed_v<T>>>::summand[]
0, 1, 2, static_cast<T>(std::numeric_limits<T>::max() - 1), std::numeric_limits<T>::max()};

template <typename T>
const bool AdditionTestValues<
T, std::enable_if_t<!std::is_signed_v<T>>>::overflow[case_count][case_count] = {
const bool AdditionTestValues<T, std::enable_if_t<!std::is_signed_v<T>>>::overflow[case_count][case_count] = {
// 0
{false, false, false, false, false},
// 1
Expand Down Expand Up @@ -72,24 +71,23 @@ const T AdditionTestValues<T, std::enable_if_t<std::is_signed_v<T>>>::summand[]
std::numeric_limits<T>::max()};

template <typename T>
const bool
AdditionTestValues<T, std::enable_if_t<std::is_signed_v<T>>>::overflow[case_count][case_count] = {
// min
{true, true, true, false, false, false, false, false},
// min + 1
{true, true, false, false, false, false, false, false},
// -1
{true, false, false, false, false, false, false, false},
// 0
{false, false, false, false, false, false, false, false},
// 1
{false, false, false, false, false, false, false, true},
// 2
{false, false, false, false, false, false, true, true},
// max - 1
{false, false, false, false, false, true, true, true},
// max
{false, false, false, false, true, true, true, true}};
const bool AdditionTestValues<T, std::enable_if_t<std::is_signed_v<T>>>::overflow[case_count][case_count] = {
// min
{true, true, true, false, false, false, false, false},
// min + 1
{true, true, false, false, false, false, false, false},
// -1
{true, false, false, false, false, false, false, false},
// 0
{false, false, false, false, false, false, false, false},
// 1
{false, false, false, false, false, false, false, true},
// 2
{false, false, false, false, false, false, true, true},
// max - 1
{false, false, false, false, false, true, true, true},
// max
{false, false, false, false, true, true, true, true}};

/*!
* Test the addition of all combinations of AdditionTestValues<T>::summand[i],
Expand Down

0 comments on commit dc5dc0d

Please sign in to comment.