mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
win: avoid warnings in string_number_conversion_test.cc
R=mark@chromium.org BUG=crashpad:1 Review URL: https://codereview.chromium.org/807463004
This commit is contained in:
parent
b0cf01978d
commit
4263334db8
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user