| 277 | } |
| 278 | |
| 279 | std::string RandomString(int length) { |
| 280 | const char kAlphaNum[] = |
| 281 | "0123456789" |
| 282 | "!@#$%^&*" |
| 283 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 284 | "abcdefghijklmnopqrstuvwxyz"; |
| 285 | const int kAlphaSize = sizeof(kAlphaNum) - 1; |
| 286 | const int size = rand() % length + 1; |
| 287 | std::string result; |
| 288 | for (int i = 0; i < size; ++i) { |
| 289 | result += kAlphaNum[rand() % kAlphaSize]; |
| 290 | } |
| 291 | return result; |
| 292 | } |
| 293 | |
| 294 | TEST(ModelInterfaceTest, PieceToIdStressTest) { |
| 295 | for (const auto type : kModelTypes) { |