Fix compiler warnings issue found in conformance_test_runner#8189 (#8190)

pull/8295/head
Abhishek Jain 4 years ago committed by GitHub
parent e1b26fe4a1
commit 0ef575beff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      conformance/binary_json_conformance_suite.cc
  2. 4
      conformance/conformance_test_runner.cc

@ -300,7 +300,7 @@ const FieldDescriptor* GetFieldForOneofType(FieldDescriptor::Type type,
}
string UpperCase(string str) {
for (int i = 0; i < str.size(); i++) {
for (size_t i = 0; i < str.size(); i++) {
str[i] = toupper(str[i]);
}
return str;

@ -297,7 +297,7 @@ void ForkPipeRunner::SpawnTestProgram() {
std::vector<const char *> argv;
argv.push_back(executable.get());
for (int i = 0; i < executable_args_.size(); ++i) {
for (size_t i = 0; i < executable_args_.size(); ++i) {
argv.push_back(executable_args_[i].c_str());
}
argv.push_back(nullptr);
@ -307,7 +307,7 @@ void ForkPipeRunner::SpawnTestProgram() {
}
void ForkPipeRunner::CheckedWrite(int fd, const void *buf, size_t len) {
if (write(fd, buf, len) != len) {
if (static_cast<size_t>(write(fd, buf, len)) != len) {
GOOGLE_LOG(FATAL) << current_test_name_
<< ": error writing to test program: " << strerror(errno);
}

Loading…
Cancel
Save