fix -Wconversion issues in util tests

Change-Id: I51a57df459f8f3a79f7d2df7a823820bccb55bd0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2832209
Reviewed-by: Francois Rousseau <frousseau@google.com>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Dangyi Liu 2021-04-16 21:29:33 +00:00 committed by Commit Bot
parent 7743306709
commit 2c1261fca7
2 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ void TestGzipDeflateInflate(const std::string& string) {
std::string MakeString(size_t size) {
std::string string;
for (size_t i = 0; i < size; ++i) {
string.append(1, (i % 256) ^ ((i >> 8) % 256));
string.append(1, static_cast<char>((i % 256) ^ ((i >> 8) % 256)));
}
return string;
}

View File

@ -104,7 +104,7 @@ void DoChildReadTestSetup(size_t* region_size,
*region_size = 4 * base::GetPageSize();
region->reset(new char[*region_size]);
for (size_t index = 0; index < *region_size; ++index) {
(*region)[index] = index % 256;
(*region)[index] = static_cast<char>(index % 256);
}
}
@ -367,7 +367,7 @@ TEST(ProcessMemory, ReadCStringSizeLimitedChild) {
void DoReadUnmappedChildMainSetup(void* page) {
char* region = reinterpret_cast<char*>(page);
for (size_t index = 0; index < base::GetPageSize(); ++index) {
region[index] = index % 256;
region[index] = static_cast<char>(index % 256);
}
}