MOUNT_UPDATE_REQ = 4,
} REQ_TYPE;
-char *install_req_filter[] = {
+const char* install_req_filter[] = {
"--gtest_filter=SmokeTest.RecoveryMode_Tpk_Installation",
"--gtest_filter=SmokeTest.RecoveryMode_Tpk_Update",
"--gtest_filter=SmokeTest.RecoveryMode_ForDelta",
} // namespace smoke_test
-#define BUF_SIZE 1024
+const int kBufSize = 1024;
const char *short_options = "iudmn:l:t:r";
const struct option long_options[] = {
}
try {
- char buf[BUF_SIZE];
+ char buf[10][kBufSize] = { 0, };
std::vector<char *> gtest_argv;
- gtest_argv.push_back(NULL);
- gtest_argv.push_back(install_req_filter[req_type]);
+ gtest_argv.push_back(nullptr);
+ snprintf(buf[gtest_argv.size()], kBufSize,
+ "%s", install_req_filter[req_type]);
+ gtest_argv.push_back(buf[gtest_argv.size()]);
if (repeat) {
- snprintf(buf, sizeof(buf), "--gtest_repeat=%d", repeat_count);
- gtest_argv.push_back(buf);
+ snprintf(buf[gtest_argv.size()], kBufSize,
+ "--gtest_repeat=%d", repeat_count);
+ gtest_argv.push_back(buf[gtest_argv.size()]);
}
- gtest_argv.push_back(NULL);
+ gtest_argv.push_back(nullptr);
int gtest_argc = gtest_argv.size();
testing::InitGoogleTest(>est_argc, gtest_argv.data());