Tests conversion of s to double and float with +/- prefixing (and no prefix) and with and without leading/trailing whitespace
| 120 | // Tests conversion of s to double and float with +/- prefixing (and no prefix) and with |
| 121 | // and without leading/trailing whitespace |
| 122 | void TestAllFloatVariants(const string& s, StringParser::ParseResult exp_result) { |
| 123 | string sign[] = {"", "+", "-"}; |
| 124 | for (int i = 0; i < space_len; ++i) { |
| 125 | for (int j = 0; j < space_len; ++j) { |
| 126 | for (int k = 0; k < 3; ++k) { |
| 127 | // All combinations of leading and/or trailing whitespace and +/- sign. |
| 128 | string str = space[i] + sign[k] + s + space[j]; |
| 129 | TestFloatValue<float>(str, exp_result); |
| 130 | TestFloatValue<double>(str, exp_result); |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | template<typename T> |
| 137 | void TestFloatBruteForce() { |