Skip to content

Conversation

@Grummel7
Copy link
Contributor

This could be a way to fix #4811

@Grummel7 Grummel7 added component:build system The Issue/PR deals with CMake, Visual Studio or the general build process. category:tweak The PR contains insignificant code changes, like code style grooming or value tweaking. labels Jun 29, 2024
@Grummel7 Grummel7 requested a review from geoffthemedio June 29, 2024 14:54
#ifdef STATIC_RANDOM_TESTS
inline consteval uint32_t CxPRNG(int16_t n = counter_val, std::array<char, 9> seed = std::array<char, 9>{__TIME__}) {
#else
inline consteval uint32_t CxPRNG(int16_t n = counter_val, std::array<char, 9> seed = std::array<char, 9>{"12:34:56"}) {
Copy link
Member

@geoffthemedio geoffthemedio Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__TIME__ also appears on line 70 / 74

@geoffthemedio
Copy link
Member

geoffthemedio commented Jul 24, 2024

Does the new #define default off / not defined? Would it make sense to set it in enable_testing() ?

@o01eg
Copy link
Contributor

o01eg commented Jul 24, 2024

Would it make sense to set it in enable_testing() ?

Yes, it looks reasonable.

}
inline consteval int32_t RandIntCx(const int32_t min, const int32_t max, const int16_t n,
const std::array<char, 9> seed = std::array<char, 9>{__TIME__}) noexcept
#ifdef STATIC_RANDOM_TESTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using a #define TEST_TIME_SEED [...] to avoid putting ifdef multiple times in the source code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:tweak The PR contains insignificant code changes, like code style grooming or value tweaking. component:build system The Issue/PR deals with CMake, Visual Studio or the general build process.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warning: macro "__TIME__" might prevent reproducible builds

4 participants