Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: fuzzers/icu_break_iterator_fuzzer.cc

Issue 2650653003: Make two icu fuzz targets more useful. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | fuzzers/icu_break_iterator_utf32_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 2
3 #include <stddef.h> 3 #include <stddef.h>
4 #include <stdint.h> 4 #include <stdint.h>
5 #include <memory> 5 #include <memory>
6 #include "third_party/icu/fuzzers/fuzzer_utils.h" 6 #include "third_party/icu/fuzzers/fuzzer_utils.h"
7 #include "third_party/icu/source/common/unicode/brkiter.h" 7 #include "third_party/icu/source/common/unicode/brkiter.h"
8 8
9 IcuEnvironment* env = new IcuEnvironment(); 9 IcuEnvironment* env = new IcuEnvironment();
10 10
(...skipping 17 matching lines...) Expand all
28 case 2: 28 case 2:
29 bi.reset(icu::BreakIterator::createCharacterInstance(locale, status)); 29 bi.reset(icu::BreakIterator::createCharacterInstance(locale, status));
30 break; 30 break;
31 case 3: 31 case 3:
32 bi.reset(icu::BreakIterator::createSentenceInstance(locale, status)); 32 bi.reset(icu::BreakIterator::createSentenceInstance(locale, status));
33 break; 33 break;
34 case 4: 34 case 4:
35 bi.reset(icu::BreakIterator::createTitleInstance(locale, status)); 35 bi.reset(icu::BreakIterator::createTitleInstance(locale, status));
36 break; 36 break;
37 } 37 }
38 if (U_FAILURE(status)) return 0; 38 if (U_FAILURE(status))
39 return 0;
40 bi->setText(str);
39 41
40 for (int32_t p = bi->first(); p != icu::BreakIterator::DONE; p = bi->next()) 42 for (int32_t p = bi->first(); p != icu::BreakIterator::DONE; p = bi->next())
41 if (U_FAILURE(status)) return 0; 43 if (U_FAILURE(status))
44 return 0;
42 45
43 return 0; 46 return 0;
44 } 47 }
45 48
OLDNEW
« no previous file with comments | « no previous file | fuzzers/icu_break_iterator_utf32_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698