ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
|
#include <FuzzedDataProvider.h>
Public Member Functions | |
FuzzedDataProvider (const uint8_t *data, size_t size) | |
~FuzzedDataProvider ()=default | |
template<typename T > | |
std::vector< T > | ConsumeBytes (size_t num_bytes) |
template<typename T > | |
std::vector< T > | ConsumeBytesWithTerminator (size_t num_bytes, T terminator=0) |
template<typename T > | |
std::vector< T > | ConsumeRemainingBytes () |
std::string | ConsumeBytesAsString (size_t num_bytes) |
std::string | ConsumeRandomLengthString (size_t max_length) |
std::string | ConsumeRandomLengthString () |
std::string | ConsumeRemainingBytesAsString () |
template<typename T > | |
T | ConsumeIntegral () |
template<typename T > | |
T | ConsumeIntegralInRange (T min, T max) |
template<typename T > | |
T | ConsumeFloatingPoint () |
template<typename T > | |
T | ConsumeFloatingPointInRange (T min, T max) |
template<typename T > | |
T | ConsumeProbability () |
bool | ConsumeBool () |
template<typename T > | |
T | ConsumeEnum () |
template<typename T , size_t size> | |
T | PickValueInArray (const T(&array)[size]) |
template<typename T > | |
T | PickValueInArray (std::initializer_list< const T > list) |
size_t | ConsumeData (void *destination, size_t num_bytes) |
size_t | remaining_bytes () |
Private Member Functions | |
FuzzedDataProvider (const FuzzedDataProvider &)=delete | |
FuzzedDataProvider & | operator= (const FuzzedDataProvider &)=delete |
void | CopyAndAdvance (void *destination, size_t num_bytes) |
void | Advance (size_t num_bytes) |
template<typename T > | |
std::vector< T > | ConsumeBytes (size_t size, size_t num_bytes) |
template<typename TS , typename TU > | |
TS | ConvertUnsignedToSigned (TU value) |
Private Attributes | |
const uint8_t * | data_ptr_ |
size_t | remaining_bytes_ |
Definition at line 29 of file FuzzedDataProvider.h.
Definition at line 33 of file FuzzedDataProvider.h.
|
default |
|
privatedelete |
|
inlineprivate |
Definition at line 333 of file FuzzedDataProvider.h.
References data_ptr_, and remaining_bytes_.
Referenced by ConsumeBytesAsString(), ConsumeRandomLengthString(), and CopyAndAdvance().
|
inline |
Definition at line 284 of file FuzzedDataProvider.h.
Referenced by ConsumeFloatingPointInRange().
std::vector< T > FuzzedDataProvider::ConsumeBytes | ( | size_t | num_bytes | ) |
Definition at line 104 of file FuzzedDataProvider.h.
References min(), and remaining_bytes_.
|
private |
Definition at line 342 of file FuzzedDataProvider.h.
References CopyAndAdvance(), static_assert, and uint8_t.
|
inline |
Definition at line 132 of file FuzzedDataProvider.h.
References Advance(), data_ptr_, min(), remaining_bytes_, static_assert, and uint8_t.
Referenced by ConsumeRemainingBytesAsString().
std::vector< T > FuzzedDataProvider::ConsumeBytesWithTerminator | ( | size_t | num_bytes, |
T | terminator = 0 |
||
) |
Definition at line 114 of file FuzzedDataProvider.h.
References min(), and remaining_bytes_.
Definition at line 319 of file FuzzedDataProvider.h.
References CopyAndAdvance(), min(), and remaining_bytes_.
T FuzzedDataProvider::ConsumeEnum |
Definition at line 291 of file FuzzedDataProvider.h.
References static_assert, and uint32_t.
T FuzzedDataProvider::ConsumeFloatingPoint |
Definition at line 235 of file FuzzedDataProvider.h.
References max().
T FuzzedDataProvider::ConsumeFloatingPointInRange | ( | T | min, |
T | max | ||
) |
Definition at line 244 of file FuzzedDataProvider.h.
References ConsumeBool(), max(), and min().
T FuzzedDataProvider::ConsumeIntegral |
Definition at line 190 of file FuzzedDataProvider.h.
References ConsumeIntegralInRange(), max(), and min().
T FuzzedDataProvider::ConsumeIntegralInRange | ( | T | min, |
T | max | ||
) |
Definition at line 200 of file FuzzedDataProvider.h.
References CHAR_BIT, data_ptr_, max(), min(), remaining_bytes_, static_assert, and uint64_t.
Referenced by ConsumeIntegral().
T FuzzedDataProvider::ConsumeProbability |
Definition at line 268 of file FuzzedDataProvider.h.
References max(), static_assert, get_metrics::type, uint32_t, and uint64_t.
|
inline |
Definition at line 176 of file FuzzedDataProvider.h.
References remaining_bytes_.
|
inline |
Definition at line 148 of file FuzzedDataProvider.h.
References Advance(), data_ptr_, min(), and remaining_bytes_.
std::vector< T > FuzzedDataProvider::ConsumeRemainingBytes |
Definition at line 124 of file FuzzedDataProvider.h.
References remaining_bytes_.
|
inline |
Definition at line 183 of file FuzzedDataProvider.h.
References ConsumeBytesAsString(), and remaining_bytes_.
|
private |
Definition at line 368 of file FuzzedDataProvider.h.
References max(), min(), static_assert, and TS.
|
inlineprivate |
Definition at line 327 of file FuzzedDataProvider.h.
References Advance(), data_ptr_, and memcpy().
Referenced by ConsumeBytes(), and ConsumeData().
|
privatedelete |
T FuzzedDataProvider::PickValueInArray | ( | const T(&) | array[size] | ) |
Definition at line 299 of file FuzzedDataProvider.h.
References static_assert.
T FuzzedDataProvider::PickValueInArray | ( | std::initializer_list< const T > | list | ) |
Definition at line 305 of file FuzzedDataProvider.h.
|
inline |
Definition at line 80 of file FuzzedDataProvider.h.
References remaining_bytes_.
|
private |
Definition at line 95 of file FuzzedDataProvider.h.
Referenced by Advance(), ConsumeBytesAsString(), ConsumeIntegralInRange(), ConsumeRandomLengthString(), and CopyAndAdvance().
|
private |
Definition at line 96 of file FuzzedDataProvider.h.
Referenced by Advance(), ConsumeBytes(), ConsumeBytesAsString(), ConsumeBytesWithTerminator(), ConsumeData(), ConsumeIntegralInRange(), ConsumeRandomLengthString(), ConsumeRemainingBytes(), ConsumeRemainingBytesAsString(), and remaining_bytes().