You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by md...@apache.org on 2018/06/28 15:21:03 UTC

[parquet-cpp] branch master updated: PARQUET-1340: Fix Travis Ci valgrind errors related to std::random_de…

This is an automated email from the ASF dual-hosted git repository.

mdeepak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new be4c532  PARQUET-1340: Fix Travis Ci valgrind errors related to std::random_de…
be4c532 is described below

commit be4c532139e9542fd42c4a65dc7928c512023582
Author: Deepak Majeti <de...@hpe.com>
AuthorDate: Thu Jun 28 11:20:54 2018 -0400

    PARQUET-1340: Fix Travis Ci valgrind errors related to std::random_de…
    
    …vice
    Followed fix from https://github.com/apache/arrow/pull/2039/files
    
    Author: Deepak Majeti <de...@hpe.com>
    
    Closes #473 from majetideepak/PARQUET-1340 and squashes the following commits:
    
    fcd6f2d [Deepak Majeti] add cast
    7193d43 [Deepak Majeti] PARQUET-1340: Fix Travis Ci valgrind errors related to std::random_device
---
 src/parquet/util/test-common.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/parquet/util/test-common.h b/src/parquet/util/test-common.h
index 22b748e..4e95870 100644
--- a/src/parquet/util/test-common.h
+++ b/src/parquet/util/test-common.h
@@ -18,6 +18,7 @@
 #ifndef PARQUET_UTIL_TEST_COMMON_H
 #define PARQUET_UTIL_TEST_COMMON_H
 
+#include <chrono>
 #include <iostream>
 #include <limits>
 #include <random>
@@ -101,8 +102,8 @@ static inline vector<bool> flip_coins_seed(int n, double p, uint32_t seed) {
 }
 
 static inline vector<bool> flip_coins(int n, double p) {
-  std::random_device rd;
-  std::mt19937 gen(rd());
+  uint64_t seed = std::chrono::high_resolution_clock::now().time_since_epoch().count();
+  std::mt19937 gen(static_cast<uint32_t>(seed));
 
   std::bernoulli_distribution d(p);