Skip to content

Commit

Permalink
Automated update of 3rd party dependencies
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 4621d550e9d72410d3c7f19a0a19a5d7a3dcbe6e
  • Loading branch information
Vertexwahn committed Oct 20, 2024
1 parent 2774725 commit 4f94667
Show file tree
Hide file tree
Showing 36 changed files with 458 additions and 95 deletions.
2 changes: 1 addition & 1 deletion devertexwahn/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.0rc4
7.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace Catch {
double diff = b - m;
return a + diff * diff;
} ) /
( last - first );
static_cast<double>( last - first );
return std::sqrt( variance );
}

Expand Down Expand Up @@ -213,7 +213,7 @@ namespace Catch {
double* first,
double* last ) {
auto count = last - first;
double idx = (count - 1) * k / static_cast<double>(q);
double idx = static_cast<double>((count - 1) * k) / static_cast<double>(q);
int j = static_cast<int>(idx);
double g = idx - j;
std::nth_element(first, first + j, last);
Expand Down Expand Up @@ -316,10 +316,10 @@ namespace Catch {

double accel = sum_cubes / ( 6 * std::pow( sum_squares, 1.5 ) );
long n = static_cast<long>( resample.size() );
double prob_n =
double prob_n = static_cast<double>(
std::count_if( resample.begin(),
resample.end(),
[point]( double x ) { return x < point; } ) /
[point]( double x ) { return x < point; } )) /
static_cast<double>( n );
// degenerate case with uniform samples
if ( Catch::Detail::directCompare( prob_n, 0. ) ) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/Catch2/src/catch2/catch_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Catch {
return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
}
auto Timer::getElapsedSeconds() const -> double {
return getElapsedMicroseconds()/1000000.0;
return static_cast<double>(getElapsedMicroseconds())/1000000.0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ namespace {
#endif // Windows/ ANSI/ None


#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ )
# define CATCH_INTERNAL_HAS_ISATTY
# include <unistd.h>
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace {
SimplePcg32::result_type SimplePcg32::operator()() {
// prepare the output value
const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u);
const auto output = rotate_right(xorshifted, m_state >> 59u);
const auto output = rotate_right(xorshifted, static_cast<uint32_t>(m_state >> 59u));

// advance state
m_state = m_state * 6364136223846793005ULL + s_inc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,55 +96,64 @@ namespace Catch {
* Creates a matcher that checks if all elements in a range are equal
* to all elements in another range.
*
* Uses `std::equal_to` to do the comparison
* Uses the provided predicate `predicate` to do the comparisons
* (defaulting to `std::equal_to`)
*/
template <typename RangeLike>
template <typename RangeLike,
typename Equality = decltype( std::equal_to<>{} )>
constexpr
std::enable_if_t<!Detail::is_matcher<RangeLike>::value,
RangeEqualsMatcher<RangeLike, std::equal_to<>>>
RangeEquals( RangeLike&& range ) {
return { CATCH_FORWARD( range ), std::equal_to<>{} };
RangeEqualsMatcher<RangeLike, Equality>
RangeEquals( RangeLike&& range,
Equality&& predicate = std::equal_to<>{} ) {
return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) };
}

/**
* Creates a matcher that checks if all elements in a range are equal
* to all elements in another range.
* to all elements in an initializer list.
*
* Uses to provided predicate `predicate` to do the comparisons
* Uses the provided predicate `predicate` to do the comparisons
* (defaulting to `std::equal_to`)
*/
template <typename RangeLike, typename Equality>
template <typename T,
typename Equality = decltype( std::equal_to<>{} )>
constexpr
RangeEqualsMatcher<RangeLike, Equality>
RangeEquals( RangeLike&& range, Equality&& predicate ) {
return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) };
RangeEqualsMatcher<std::initializer_list<T>, Equality>
RangeEquals( std::initializer_list<T> range,
Equality&& predicate = std::equal_to<>{} ) {
return { range, CATCH_FORWARD( predicate ) };
}

/**
* Creates a matcher that checks if all elements in a range are equal
* to all elements in another range, in some permutation
* to all elements in another range, in some permutation.
*
* Uses `std::equal_to` to do the comparison
* Uses the provided predicate `predicate` to do the comparisons
* (defaulting to `std::equal_to`)
*/
template <typename RangeLike>
template <typename RangeLike,
typename Equality = decltype( std::equal_to<>{} )>
constexpr
std::enable_if_t<
!Detail::is_matcher<RangeLike>::value,
UnorderedRangeEqualsMatcher<RangeLike, std::equal_to<>>>
UnorderedRangeEquals( RangeLike&& range ) {
return { CATCH_FORWARD( range ), std::equal_to<>{} };
UnorderedRangeEqualsMatcher<RangeLike, Equality>
UnorderedRangeEquals( RangeLike&& range,
Equality&& predicate = std::equal_to<>{} ) {
return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) };
}

/**
* Creates a matcher that checks if all elements in a range are equal
* to all elements in another range, in some permutation.
* to all elements in an initializer list, in some permutation.
*
* Uses to provided predicate `predicate` to do the comparisons
* Uses the provided predicate `predicate` to do the comparisons
* (defaulting to `std::equal_to`)
*/
template <typename RangeLike, typename Equality>
template <typename T,
typename Equality = decltype( std::equal_to<>{} )>
constexpr
UnorderedRangeEqualsMatcher<RangeLike, Equality>
UnorderedRangeEquals( RangeLike&& range, Equality&& predicate ) {
return { CATCH_FORWARD( range ), CATCH_FORWARD( predicate ) };
UnorderedRangeEqualsMatcher<std::initializer_list<T>, Equality>
UnorderedRangeEquals( std::initializer_list<T> range,
Equality&& predicate = std::equal_to<>{} ) {
return { range, CATCH_FORWARD( predicate ) };
}
} // namespace Matchers
} // namespace Catch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( vector_a_
MatchersRanges.tests.cpp:<line number>: passed: vector_a, !RangeEquals( vector_b, close_enough ) for: { 1, 2, 3 } not elements are { 3, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } elements are { 1, 2, 3, 4, 5 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 }
MatchersRanges.tests.cpp:<line number>: passed: mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 }
MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[1] for: true
Expand All @@ -2304,6 +2306,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals(
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 }
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2
Expand Down Expand Up @@ -2851,6 +2855,6 @@ InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected
assertions: 2265 | 2083 passed | 147 failed | 35 failed as expected
assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected


Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( vector_a_
MatchersRanges.tests.cpp:<line number>: passed: vector_a, !RangeEquals( vector_b, close_enough ) for: { 1, 2, 3 } not elements are { 3, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } elements are { 1, 2, 3, 4, 5 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, RangeEquals( needs_adl3, []( int l, int r ) { return l + 1 == r; } ) for: { 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 1, 2, 3 } ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) for: { 1, 2, 3 } elements are { 2, 4, 6 }
MatchersRanges.tests.cpp:<line number>: passed: mocked1, !RangeEquals( arr ) for: { 1, 2, 3, 4 } not elements are { 1, 2, 4, 4 }
MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked1.m_derefed[1] for: true
Expand All @@ -2297,6 +2299,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals(
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( vector_a_plus_1, close_enough ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, !UnorderedRangeEquals( vector_b, close_enough ) for: { 1, 10, 21 } not unordered elements are { 11, 21, 3 }
MatchersRanges.tests.cpp:<line number>: passed: needs_adl1, UnorderedRangeEquals( needs_adl2 ) for: { 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 10, 20, 1 } ) for: { 1, 10, 20 } unordered elements are { 10, 20, 1 }
MatchersRanges.tests.cpp:<line number>: passed: array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) for: { 1, 10, 20 } unordered elements are { 11, 21, 2 }
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2
Expand Down Expand Up @@ -2840,6 +2844,6 @@ InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected
assertions: 2265 | 2083 passed | 147 failed | 35 failed as expected
assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected


Original file line number Diff line number Diff line change
Expand Up @@ -1611,5 +1611,5 @@ due to unexpected exception with message:

===============================================================================
test cases: 419 | 327 passed | 71 failed | 7 skipped | 14 failed as expected
assertions: 2248 | 2083 passed | 130 failed | 35 failed as expected
assertions: 2252 | 2087 passed | 130 failed | 35 failed as expected

Original file line number Diff line number Diff line change
Expand Up @@ -14981,6 +14981,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 }

-------------------------------------------------------------------------------
Usage of RangeEquals range matcher
Compare against std::initializer_list
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, RangeEquals( { 1, 2, 3 } ) )
with expansion:
{ 1, 2, 3 } elements are { 1, 2, 3 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) )
with expansion:
{ 1, 2, 3 } elements are { 2, 4, 6 }

-------------------------------------------------------------------------------
Usage of RangeEquals range matcher
Check short-circuiting behaviour
Expand Down Expand Up @@ -15168,6 +15185,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 }

-------------------------------------------------------------------------------
Usage of UnorderedRangeEquals range matcher
Compare against std::initializer_list
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, UnorderedRangeEquals( { 10, 20, 1 } ) )
with expansion:
{ 1, 10, 20 } unordered elements are { 10, 20, 1 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) )
with expansion:
{ 1, 10, 20 } unordered elements are { 11, 21, 2 }

-------------------------------------------------------------------------------
Usage of the SizeIs range matcher
Some with stdlib containers
Expand Down Expand Up @@ -18979,5 +19013,5 @@ Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected
assertions: 2265 | 2083 passed | 147 failed | 35 failed as expected
assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected

Original file line number Diff line number Diff line change
Expand Up @@ -14974,6 +14974,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3, 4, 5 } elements are { 2, 3, 4, 5, 6 }

-------------------------------------------------------------------------------
Usage of RangeEquals range matcher
Compare against std::initializer_list
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, RangeEquals( { 1, 2, 3 } ) )
with expansion:
{ 1, 2, 3 } elements are { 1, 2, 3 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, RangeEquals( { 2, 4, 6 }, []( int l, int r ) { return l * 2 == r; } ) )
with expansion:
{ 1, 2, 3 } elements are { 2, 4, 6 }

-------------------------------------------------------------------------------
Usage of RangeEquals range matcher
Check short-circuiting behaviour
Expand Down Expand Up @@ -15161,6 +15178,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3, 4, 5 } unordered elements are { 1, 2, 3, 4, 5 }

-------------------------------------------------------------------------------
Usage of UnorderedRangeEquals range matcher
Compare against std::initializer_list
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, UnorderedRangeEquals( { 10, 20, 1 } ) )
with expansion:
{ 1, 10, 20 } unordered elements are { 10, 20, 1 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( array_a, UnorderedRangeEquals( { 11, 21, 2 }, []( int l, int r ) { return std::abs( l - r ) <= 1; } ) )
with expansion:
{ 1, 10, 20 } unordered elements are { 11, 21, 2 }

-------------------------------------------------------------------------------
Usage of the SizeIs range matcher
Some with stdlib containers
Expand Down Expand Up @@ -18968,5 +19002,5 @@ Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected
assertions: 2265 | 2083 passed | 147 failed | 35 failed as expected
assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected

Loading

0 comments on commit 4f94667

Please sign in to comment.