Baton::ready, a const variant of try_wait
[folly.git] / folly / test / RandomTest.cpp
index da906f69bc42f24cf2a49b86dd4f64c582597739..d36275750033eec1dc9a64b96612b8c7ddb2a3f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include <folly/Random.h>
 
-#include <glog/logging.h>
-
 #include <algorithm>
-#include <thread>
-#include <vector>
 #include <random>
+#include <thread>
 #include <unordered_set>
+#include <vector>
+
+#include <glog/logging.h>
 
 #include <folly/portability/GTest.h>
 
@@ -32,13 +32,13 @@ TEST(Random, StateSize) {
   using namespace folly::detail;
 
   // uint_fast32_t is uint64_t on x86_64, w00t
-  EXPECT_EQ(sizeof(uint_fast32_t) / 4 + 3,
-            StateSize<std::minstd_rand0>::value);
-  EXPECT_EQ(624, StateSize<std::mt19937>::value);
+  EXPECT_EQ(
+      sizeof(uint_fast32_t) / 4 + 3, StateSizeT<std::minstd_rand0>::value);
+  EXPECT_EQ(624, StateSizeT<std::mt19937>::value);
 #if FOLLY_HAVE_EXTRANDOM_SFMT19937
-  EXPECT_EQ(624, StateSize<__gnu_cxx::sfmt19937>::value);
+  EXPECT_EQ(624, StateSizeT<__gnu_cxx::sfmt19937>::value);
 #endif
-  EXPECT_EQ(24, StateSize<std::ranlux24_base>::value);
+  EXPECT_EQ(24, StateSizeT<std::ranlux24_base>::value);
 }
 
 TEST(Random, Simple) {
@@ -135,6 +135,6 @@ TEST(Random, sanity) {
     }
     EXPECT_EQ(
         vals.size(),
-        std::unordered_set<uint32_t>(vals.begin(), vals.end()).size());
+        std::unordered_set<uint64_t>(vals.begin(), vals.end()).size());
   }
 }