Skip to content

Commit

Permalink
Fix compiler warnings issue found in conformance_test_runner#8189
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Jain <abhishek.jain3@huawei.com>
  • Loading branch information
akjain2052 authored and Abhishek Jain committed Jan 7, 2021
1 parent 9647a7c commit 03ac7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conformance/binary_json_conformance_suite.cc
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions conformance/conformance_test_runner.cc
Expand Up @@ -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);
Expand All @@ -307,7 +307,8 @@ void ForkPipeRunner::SpawnTestProgram() {
}

void ForkPipeRunner::CheckedWrite(int fd, const void *buf, size_t len) {
if (write(fd, buf, len) != len) {
size_t bytes_write = write(fd, buf, len);
if (bytes_write != len) {
GOOGLE_LOG(FATAL) << current_test_name_
<< ": error writing to test program: " << strerror(errno);
}
Expand Down

0 comments on commit 03ac7a1

Please sign in to comment.