Skip to content

stdlib testing: make PRNG from SwiftPrivate deterministic #1970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions stdlib/public/stubs/LibcShims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ size_t _swift_stdlib_malloc_size(const void *ptr) {
#error No malloc_size analog known for this platform/libc.
#endif

static std::random_device RandomeDevice;
static std::mt19937 MersenneRandom(RandomeDevice());
static std::mt19937 MersenneRandom;

__swift_uint32_t _swift_stdlib_cxx11_mt19937(void) {
return MersenneRandom();
Expand Down
11 changes: 0 additions & 11 deletions validation-test/stdlib/Hashing.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
// FIXME: This test fails with some expected probability because
// it is testing the statistical nature of the hashing.
// The test failing probabilistically is bad for regression testing,
// which causes test failures for this test to both be largely
// ignored but also can cause the entire test suite to fail
// unexpectedly.
//
// This test is being DISABLED until it is written in a way
// for it to be reliable and useful.
//

// RUN: %target-run-stdlib-swift
// REQUIRES: executable_test

Expand Down