Fix SimpleBarrier
[folly.git] / folly / test / SparseByteSetTest.cpp
index f5f6f1a1103730dff6f69eef41a0abc88290e4da..180e0ced97c30ff822e48520f680672a5becd446 100644 (file)
@@ -21,7 +21,7 @@
 #include <random>
 #include <set>
 
-#include <gtest/gtest.h>
+#include <folly/portability/GTest.h>
 
 using namespace std;
 using namespace folly;
@@ -55,10 +55,10 @@ TEST_F(SparseByteSetTest, each) {
 
 TEST_F(SparseByteSetTest, each_random) {
   mt19937 rng;
-  uniform_int_distribution<uint8_t> dist;
+  uniform_int_distribution<uint16_t> dist{lims::min(), lims::max()};
   set<uint8_t> added;
   while (added.size() <= lims::max()) {
-    auto c = dist(rng);
+    auto c = uint8_t(dist(rng));
     EXPECT_EQ(added.count(c), s.contains(c));
     EXPECT_EQ(!added.count(c), s.add(c));
     added.insert(c);