Lines Matching refs:fuzz
8 #include "fuzz/Fuzz.h"
9 #include "fuzz/FuzzCommon.h"
116 uint8_t RandomText(T* buffer, Fuzz* fuzz) {
118 fuzz->nextRange(&text_length, 0, MAX_TEXT_LENGTH);
119 fuzz->nextN(buffer, text_length);
124 void AddASCIIText(ParagraphBuilder* builder,Fuzz* fuzz) {
126 const auto text_length = RandomText(text, fuzz);
130 void AddUnicodeText(ParagraphBuilder* builder,Fuzz* fuzz) {
132 const auto text_length = RandomText(text, fuzz);
141 void AddZalgoText(ParagraphBuilder* builder, Fuzz* fuzz) {
143 const auto text_length = RandomText(text, fuzz);
149 fuzz->next(&mark_count);
152 fuzz->next(&mark_type, &mark_index);
170 void AddStyle(ParagraphBuilder* builder, Fuzz* fuzz) {
197 void RemoveStyle(ParagraphBuilder* builder, Fuzz* fuzz) {
199 fuzz->next(&pop);
205 void AddStyleAndText(ParagraphBuilder* builder, Fuzz* fuzz) {
206 AddStyle(builder, fuzz);
208 fuzz->next(&text_type);
211 AddASCIIText(builder, fuzz);
214 AddUnicodeText(builder, fuzz);
217 AddZalgoText(builder, fuzz);
220 RemoveStyle(builder, fuzz);
224 ParagraphStyle BuildParagraphStyle(Fuzz* fuzz) {
227 fuzz->next(&hinting);
235 fuzz->nextEnum(&td, TextDirection::kRtl);
238 fuzz->nextEnum(&ta, TextAlign::kEnd);
241 fuzz->next(&ml);
246 fuzz->next(&h);
250 //fuzz->nextEnum(&thb, TextHeightBehavior::kDisableAll);
258 DEF_FUZZ(SkParagraph, fuzz) {
260 ParagraphStyle paragraph_style = BuildParagraphStyle(fuzz);
264 fuzz->nextRange(&iterations, 1, MAX_TEXT_ADDITIONS);
266 AddStyleAndText(&builder, fuzz);
281 fuzz->next(&layout_width);