| 58 | |
| 59 | template <typename c_int> |
| 60 | static std::vector<std::string> MakeHexStrings(int32_t num_items) { |
| 61 | int32_t num_bytes = sizeof(c_int); |
| 62 | const char* kAsciiTable = "0123456789ABCDEF"; |
| 63 | std::vector<char> large_hex_chars(num_bytes * 2 + 2); |
| 64 | large_hex_chars[0] = '0'; |
| 65 | large_hex_chars[1] = 'x'; |
| 66 | for (int32_t i = 0; i < num_bytes * 2; ++i) { |
| 67 | large_hex_chars[i + 2] = kAsciiTable[i]; |
| 68 | } |
| 69 | std::string large_hex(&large_hex_chars[0], large_hex_chars.size()); |
| 70 | |
| 71 | std::vector<std::string> base_strings = {"0x0", "0xA5", "0x5E", large_hex}; |
| 72 | std::vector<std::string> strings; |
| 73 | for (int32_t i = 0; i < num_items; ++i) { |
| 74 | strings.push_back(base_strings[i % base_strings.size()]); |
| 75 | } |
| 76 | return strings; |
| 77 | } |
| 78 | |
| 79 | static std::vector<std::string> MakeFloatStrings(int32_t num_items) { |
| 80 | std::vector<std::string> base_strings = {"0.0", "5", "-12.3", |