Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libcxx/test/benchmarks/GenerateInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,18 @@ struct Generate<T> {
static T arbitrary() { return 42; }
static T cheap() { return 42; }
static T expensive() { return 42; }
static T random() { return getRandomInteger<T>(std::numeric_limits<T>::min(), std::numeric_limits<T>::max()); }
};

template <>
struct Generate<std::string> {
static std::string arbitrary() { return "hello world"; }
static std::string cheap() { return "small"; }
static std::string expensive() { return std::string(256, 'x'); }
static std::string random() {
auto length = getRandomInteger<std::size_t>(1, 1024);
return getRandomString(length);
}
};

#endif // BENCHMARK_GENERATE_INPUT_H
Loading
Loading