mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-22716 Extend Collator fuzzing
This commit is contained in:
parent
3a74fcf052
commit
1c3bf0bf82
1 changed files with 16 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "unicode/coll.h"
|
||||
#include "unicode/localpointer.h"
|
||||
#include "unicode/locid.h"
|
||||
#include "unicode/sortkey.h"
|
||||
#include "unicode/tblcoll.h"
|
||||
|
||||
IcuEnvironment* env = new IcuEnvironment();
|
||||
|
@ -27,5 +28,20 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
icu::LocalPointer<icu::RuleBasedCollator> col1(
|
||||
new icu::RuleBasedCollator(fuzzstr, status));
|
||||
|
||||
if (U_SUCCESS(status)) {
|
||||
col1->getVariableTop(status);
|
||||
status = U_ZERO_ERROR;
|
||||
icu::CollationKey key;
|
||||
col1->getCollationKey(fuzzstr, key, status);
|
||||
status = U_ZERO_ERROR;
|
||||
icu::LocalPointer<icu::UnicodeSet> tailoredSet(col1->getTailoredSet(status));
|
||||
status = U_ZERO_ERROR;
|
||||
col1->getLocale(ULOC_ACTUAL_LOCALE, status);
|
||||
status = U_ZERO_ERROR;
|
||||
col1->getLocale(ULOC_VALID_LOCALE, status);
|
||||
col1->getMaxVariable();
|
||||
col1->getStrength();
|
||||
col1->getSortKey(fuzzstr, nullptr, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue