Address a bunch of clang-tidy complaints.
There were a bunch more unreasonable/incorrect ones, but these ones
seemed legit. Nothing very interesting, though.
Bug: N/A
Test: ran tests, benchmarks
Change-Id: If66971194d4a7b4bf6d0251bedb88e8cdc88a76f
diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp
index 33dbfd9..6b20094 100644
--- a/tests/gtest_main.cpp
+++ b/tests/gtest_main.cpp
@@ -90,7 +90,6 @@
} // namespace testing
using testing::internal::GTestColor;
-using testing::internal::COLOR_DEFAULT;
using testing::internal::COLOR_RED;
using testing::internal::COLOR_GREEN;
using testing::internal::COLOR_YELLOW;
@@ -274,8 +273,7 @@
}
static bool EnumerateTests(int argc, char** argv, std::vector<TestCase>& testcase_list) {
- std::vector<const char*> args;
- for (int i = 0; i < argc; ++i) args.push_back(argv[i]);
+ std::vector<const char*> args(argv, argv + argc);
args.push_back("--gtest_list_tests");
args.push_back(nullptr);
@@ -543,7 +541,7 @@
const std::vector<TestCase>& testcase_list,
time_t epoch_iteration_start_time,
int64_t elapsed_time_ns) {
- FILE* fp = fopen(xml_output_filename.c_str(), "w");
+ FILE* fp = fopen(xml_output_filename.c_str(), "we");
if (fp == NULL) {
fprintf(stderr, "failed to open '%s': %s\n", xml_output_filename.c_str(), strerror(errno));
exit(1);
@@ -1185,10 +1183,7 @@
g_argc = argc;
g_argv = argv;
g_envp = envp;
- std::vector<char*> arg_list;
- for (int i = 0; i < argc; ++i) {
- arg_list.push_back(argv[i]);
- }
+ std::vector<char*> arg_list(argv, argv + argc);
IsolationTestOptions options;
if (PickOptions(arg_list, options) == false) {