#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <memory>
#include <vector>
#include "partition_alloc/partition_alloc_base/check.h"
#include "partition_alloc/partition_alloc_base/logging.h"
#include "partition_alloc/partition_alloc_base/rand_util.h"
#include "partition_alloc/partition_alloc_base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace partition_alloc::internal::base {
TEST(PartitionAllocBaseRandUtilTest, RandBytes) { … }
TEST(PartitionAllocBaseRandUtilTest, RandBytes0) { … }
TEST(PartitionAllocBaseRandUtilTest, RandGeneratorForRandomShuffle) { … }
TEST(PartitionAllocBaseRandUtilTest, RandGeneratorIsUniform) { … }
TEST(PartitionAllocBaseRandUtilTest, RandUint64ProducesBothValuesOfAllBits) { … }
TEST(PartitionAllocBaseRandUtilTest, DISABLED_RandBytesPerf) { … }
TEST(PartitionAllocBaseRandUtilTest,
InsecureRandomGeneratorProducesBothValuesOfAllBits) { … }
namespace {
constexpr double kXp1Percent = …;
constexpr double kXp99Percent = …;
double ChiSquaredCriticalValue(double nu, double x_p) { … }
int ExtractBits(uint64_t value, int from_bit, int num_bits) { … }
bool ChiSquaredTest(InsecureRandomGenerator& gen,
size_t n,
int from_bit,
int num_bits) { … }
}
TEST(PartitionAllocBaseRandUtilTest, InsecureRandomGeneratorChiSquared) { … }
}