Disallow copy and assign for DataBuilder & RandomGenerator
BUG=tint:1247 Change-Id: I48f7b1e1679bcba43e4c284b2f97a02210feabb3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66740 Auto-Submit: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ryan Harrison <rharrison@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
8045166b16
commit
5f5d43ff51
|
@ -34,7 +34,8 @@ class DataBuilder {
|
|||
explicit DataBuilder(const uint8_t* data, size_t size)
|
||||
: generator_(data, size) {}
|
||||
|
||||
~DataBuilder() {}
|
||||
~DataBuilder() = default;
|
||||
DataBuilder(DataBuilder&&) = default;
|
||||
|
||||
/// Generate pseudo-random data of a specific type
|
||||
/// @tparam T - type of data to produce
|
||||
|
@ -85,6 +86,10 @@ class DataBuilder {
|
|||
private:
|
||||
RandomGenerator generator_;
|
||||
|
||||
// Disallow copy & assign
|
||||
DataBuilder(const DataBuilder&) = delete;
|
||||
DataBuilder& operator=(const DataBuilder&) = delete;
|
||||
|
||||
/// Get N bytes of pseudo-random data
|
||||
/// @param out - pointer to location to save data
|
||||
/// @param n - number of bytes to get
|
||||
|
|
|
@ -33,6 +33,9 @@ class RandomGenerator {
|
|||
/// @param size - size of data buffer
|
||||
explicit RandomGenerator(const uint8_t* data, size_t size);
|
||||
|
||||
~RandomGenerator() = default;
|
||||
RandomGenerator(RandomGenerator&&) = default;
|
||||
|
||||
/// Get uint32_t value from uniform distribution.
|
||||
/// @param lower - lower bound of integer generated
|
||||
/// @param upper - upper bound of integer generated
|
||||
|
@ -98,6 +101,10 @@ class RandomGenerator {
|
|||
private:
|
||||
std::mt19937_64 engine_;
|
||||
|
||||
// Disallow copy & assign
|
||||
RandomGenerator(const RandomGenerator&) = delete;
|
||||
RandomGenerator& operator=(const RandomGenerator&) = delete;
|
||||
|
||||
}; // class RandomGenerator
|
||||
|
||||
} // namespace fuzzers
|
||||
|
|
Loading…
Reference in New Issue