• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2019 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #ifndef FUZZER_UTILS_H_
5 #define FUZZER_UTILS_H_
6 
7 #include <assert.h>
8 
9 #include "unicode/locid.h"
10 
11 struct IcuEnvironment {
IcuEnvironmentIcuEnvironment12   IcuEnvironment() {
13     // nothing to initialize yet;
14   }
15 };
16 
GetRandomLocale(uint16_t rnd)17 const icu::Locale& GetRandomLocale(uint16_t rnd) {
18   int32_t num_locales = 0;
19   const icu::Locale* locales = icu::Locale::getAvailableLocales(num_locales);
20   assert(num_locales > 0);
21   return locales[rnd % num_locales];
22 }
23 
24 #endif  // FUZZER_UTILS_H_
25