Index: util/stdlib/string_number_conversion_test.cc |
diff --git a/util/stdlib/string_number_conversion_test.cc b/util/stdlib/string_number_conversion_test.cc |
index ec0d44ae301dd267381923ce819a03649279d751..97d3152bbae4d9d7efc35b12234a06299c846a02 100644 |
--- a/util/stdlib/string_number_conversion_test.cc |
+++ b/util/stdlib/string_number_conversion_test.cc |
@@ -53,7 +53,7 @@ TEST(StringNumberConversion, StringToInt) { |
{"0x80000000", false, 0}, |
{"0xFFFFFFFF", false, 0}, |
{"-0x7fffffff", true, -2147483647}, |
- {"-0x80000000", true, -2147483648}, |
+ {"-0x80000000", true, std::numeric_limits<int>::min()}, |
{"-0x80000001", false, 0}, |
{"-0xffffffff", false, 0}, |
{"0x100000000", false, 0}, |
@@ -108,8 +108,10 @@ TEST(StringNumberConversion, StringToInt) { |
} |
} |
- // Ensure that embedded NUL characters are treated as bad input. |
- const char input[] = "6\0006"; |
+ // Ensure that embedded NUL characters are treated as bad input. The string |
+ // is split to avoid MSVC warning: |
+ // "decimal digit terminates octal escape sequence". |
+ const char input[] = "6\000" "6"; |
base::StringPiece input_string(input, arraysize(input) - 1); |
int output; |
EXPECT_FALSE(StringToNumber(input_string, &output)); |
@@ -204,8 +206,10 @@ TEST(StringNumberConversion, StringToUnsignedInt) { |
} |
} |
- // Ensure that embedded NUL characters are treated as bad input. |
- const char input[] = "6\0006"; |
+ // Ensure that embedded NUL characters are treated as bad input. The string |
+ // is split to avoid MSVC warning: |
+ // "decimal digit terminates octal escape sequence". |
+ const char input[] = "6\000" "6"; |
base::StringPiece input_string(input, arraysize(input) - 1); |
unsigned int output; |
EXPECT_FALSE(StringToNumber(input_string, &output)); |