diff options
| author | Martin Hořeňovský | 2020-12-29 15:03:40 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-12-29 15:03:40 +0100 |
| commit | de6fe184a9ac1a06895cdd1c9b437f0a0bdf14ad (patch) | |
| tree | 67c2ec567c3ea9b56a8eb248e457dd5ea47a07d0 /single_include | |
| parent | fe3dddcc6d41e6449a92aeaaee5fc18497fce53c (diff) | |
| download | catch3-2.13.4.tar.gz | |
v2.13.4v2.13.4
Diffstat (limited to 'single_include')
| -rw-r--r-- | single_include/catch2/catch.hpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/single_include/catch2/catch.hpp b/single_include/catch2/catch.hpp index 2a2d77a2..0384171a 100644 --- a/single_include/catch2/catch.hpp +++ b/single_include/catch2/catch.hpp @@ -1,6 +1,6 @@ /* - * Catch v2.13.3 - * Generated: 2020-10-31 18:20:31.045274 + * Catch v2.13.4 + * Generated: 2020-12-29 14:48:00.116107 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved. @@ -15,7 +15,7 @@ #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 13 -#define CATCH_VERSION_PATCH 3 +#define CATCH_VERSION_PATCH 4 #ifdef __clang__ # pragma clang system_header @@ -14126,24 +14126,28 @@ namespace Catch { namespace { struct TestHasher { - explicit TestHasher(Catch::SimplePcg32& rng_instance) { - basis = rng_instance(); - basis <<= 32; - basis |= rng_instance(); - } + using hash_t = uint64_t; - uint64_t basis; + explicit TestHasher( hash_t hashSuffix ): + m_hashSuffix{ hashSuffix } {} - uint64_t operator()(TestCase const& t) const { - // Modified FNV-1a hash - static constexpr uint64_t prime = 1099511628211; - uint64_t hash = basis; - for (const char c : t.name) { + uint32_t operator()( TestCase const& t ) const { + // FNV-1a hash with multiplication fold. + const hash_t prime = 1099511628211u; + hash_t hash = 14695981039346656037u; + for ( const char c : t.name ) { hash ^= c; hash *= prime; } - return hash; + hash ^= m_hashSuffix; + hash *= prime; + const uint32_t low{ static_cast<uint32_t>( hash ) }; + const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) }; + return low * high; } + + private: + hash_t m_hashSuffix; }; } // end unnamed namespace @@ -14161,9 +14165,9 @@ namespace Catch { case RunTests::InRandomOrder: { seedRng( config ); - TestHasher h( rng() ); + TestHasher h{ config.rngSeed() }; - using hashedTest = std::pair<uint64_t, TestCase const*>; + using hashedTest = std::pair<TestHasher::hash_t, TestCase const*>; std::vector<hashedTest> indexed_tests; indexed_tests.reserve( unsortedTestCases.size() ); @@ -15316,7 +15320,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 13, 3, "", 0 ); + static Version version( 2, 13, 4, "", 0 ); return version; } |