MCPcopy Create free account
hub / github.com/catchorg/Catch2 / generateRandomSeed

Function generateRandomSeed

extras/catch_amalgamated.cpp:5532–5546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5530namespace Catch {
5531
5532 std::uint32_t generateRandomSeed( GenerateFrom from ) {
5533 switch ( from ) {
5534 case GenerateFrom::Time:
5535 return static_cast<std::uint32_t>( std::time( nullptr ) );
5536
5537 case GenerateFrom::Default:
5538 case GenerateFrom::RandomDevice: {
5539 std::random_device rd;
5540 return Detail::fillBitsFrom<std::uint32_t>( rd );
5541 }
5542
5543 default:
5544 CATCH_ERROR("Unknown generation method");
5545 }
5546 }
5547
5548} // end namespace Catch
5549

Callers 3

ConfigDataClass · 0.70
makeCommandLineParserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected