Add a common function to generate a long string to test.

This commit is contained in:
Tsuda Kageyu
2016-10-31 19:53:17 +09:00
parent dcab8ed90e
commit e6a69e24bc
8 changed files with 38 additions and 25 deletions

View File

@ -103,6 +103,27 @@ inline bool fileEqual(const string &filename1, const string &filename2)
return stream1.good() == stream2.good();
}
#ifdef TAGLIB_STRING_H
namespace TagLib {
inline String longText(size_t length, bool random = false)
{
const wchar_t chars[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
std::wstring text(length, L'X');
if(random) {
for(size_t i = 0; i < length; ++i)
text[i] = chars[rand() % 53];
}
return String(text);
}
}
#endif
class ScopedFileCopy
{
public: