diff options
author | tender-bum <tender-bum@yandex-team.ru> | 2022-02-10 16:50:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:01 +0300 |
commit | c78b06a63de7beec995c1007bc5332bdf3d75b69 (patch) | |
tree | 729de992758f40b85278d4abaad655be5dd68dbc /library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz | |
parent | 95ab23a39b5482a434361566cabdd5b0a433cb43 (diff) | |
download | ydb-c78b06a63de7beec995c1007bc5332bdf3d75b69.tar.gz |
Restoring authorship annotation for <tender-bum@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz')
-rw-r--r-- | library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp | 108 | ||||
-rw-r--r-- | library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make | 36 |
2 files changed, 72 insertions, 72 deletions
diff --git a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp index 9b4cb4c983..7ddc13053f 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp +++ b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/fuzz.cpp @@ -3,58 +3,58 @@ #include <library/cpp/containers/flat_hash/lib/probings.h> #include <library/cpp/containers/flat_hash/lib/size_fitters.h> #include <library/cpp/containers/flat_hash/lib/expanders.h> - + #include <library/cpp/containers/flat_hash/lib/fuzz/fuzz_common/fuzz_common.h> - -#include <util/generic/hash.h> -#include <util/generic/xrange.h> -#include <util/generic/bt_exception.h> - -using namespace NFlatHash; - -namespace { - -template <class Key, class T> -using TDenseModMap = NFlatHash::TMap<Key, - T, - THash<Key>, - std::equal_to<Key>, - TRemovalDenseContainer<std::pair<const Key, T>, - NMap::TEqValueMarker<Key, T>, - NMap::TEqValueMarker<Key, T>>, - TDenseProbing, - TAndSizeFitter, - TSimpleExpander>; - -NFuzz::EActionType EvalType(ui8 data) { - return static_cast<NFuzz::EActionType>((data >> 5) & 0b111); -} - -ui8 EvalKey(ui8 data) { - return data & 0b11111; -} - -ui8 EvalValue() { - return RandomNumber<ui8>(); -} - -} // namespace - -#include <util/datetime/base.h> - -extern "C" int LLVMFuzzerTestOneInput(const ui8* const wireData, const size_t wireSize) { - THashMap<ui8, ui8> etalon; - // We assume, that markers can't be produced by EvalKey function. - TDenseModMap<ui8, ui8> testee(8, - (1 << 5), // Deleted marker - (1 << 6)); // Empty marker - - for (auto i : xrange(wireSize)) { - auto data = wireData[i]; - - NFuzz::MakeAction(etalon, testee, EvalKey(data), EvalValue(), EvalType(data)); - NFuzz::CheckInvariants(etalon, testee); - } - - return 0; -} + +#include <util/generic/hash.h> +#include <util/generic/xrange.h> +#include <util/generic/bt_exception.h> + +using namespace NFlatHash; + +namespace { + +template <class Key, class T> +using TDenseModMap = NFlatHash::TMap<Key, + T, + THash<Key>, + std::equal_to<Key>, + TRemovalDenseContainer<std::pair<const Key, T>, + NMap::TEqValueMarker<Key, T>, + NMap::TEqValueMarker<Key, T>>, + TDenseProbing, + TAndSizeFitter, + TSimpleExpander>; + +NFuzz::EActionType EvalType(ui8 data) { + return static_cast<NFuzz::EActionType>((data >> 5) & 0b111); +} + +ui8 EvalKey(ui8 data) { + return data & 0b11111; +} + +ui8 EvalValue() { + return RandomNumber<ui8>(); +} + +} // namespace + +#include <util/datetime/base.h> + +extern "C" int LLVMFuzzerTestOneInput(const ui8* const wireData, const size_t wireSize) { + THashMap<ui8, ui8> etalon; + // We assume, that markers can't be produced by EvalKey function. + TDenseModMap<ui8, ui8> testee(8, + (1 << 5), // Deleted marker + (1 << 6)); // Empty marker + + for (auto i : xrange(wireSize)) { + auto data = wireData[i]; + + NFuzz::MakeAction(etalon, testee, EvalKey(data), EvalValue(), EvalType(data)); + NFuzz::CheckInvariants(etalon, testee); + } + + return 0; +} diff --git a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make index 3a5d3d6d8c..a43dba1f61 100644 --- a/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make +++ b/library/cpp/containers/flat_hash/lib/fuzz/dense_map_fuzz/ya.make @@ -1,19 +1,19 @@ -FUZZ() - -OWNER( - tender-bum -) - -SRCS( - fuzz.cpp -) - -PEERDIR( +FUZZ() + +OWNER( + tender-bum +) + +SRCS( + fuzz.cpp +) + +PEERDIR( library/cpp/containers/flat_hash/lib/fuzz/fuzz_common -) - -SIZE(LARGE) - -TAG(ya:fat) - -END() +) + +SIZE(LARGE) + +TAG(ya:fat) + +END() |