Codestyle fixups to satisfy presubmits
This is a series of whitespace changes to align files created before
presubmit checks were enabled to match the presubmit checks that are
now in place on master.
Test: unit-tests
Change-Id: I52e769a3e7e6d390edfa067358a437f342e0e5d5
(cherry picked from commit 11d80256f35ba2995e88b129aaec9d8c7f302b7c)
diff --git a/omaha_response_handler_action_unittest.cc b/omaha_response_handler_action_unittest.cc
index 0887e1f..f25b78d 100644
--- a/omaha_response_handler_action_unittest.cc
+++ b/omaha_response_handler_action_unittest.cc
@@ -16,6 +16,7 @@
#include "update_engine/omaha_response_handler_action.h"
+#include <memory>
#include <string>
#include <base/files/file_util.h>
@@ -38,10 +39,10 @@
using chromeos_update_manager::FakeUpdateManager;
using chromeos_update_manager::MockPolicy;
using std::string;
+using testing::_;
using testing::DoAll;
using testing::Return;
using testing::SetArgPointee;
-using testing::_;
namespace chromeos_update_engine {
@@ -81,8 +82,7 @@
: public ActionProcessorDelegate {
public:
OmahaResponseHandlerActionProcessorDelegate()
- : code_(ErrorCode::kError),
- code_set_(false) {}
+ : code_(ErrorCode::kError), code_set_(false) {}
void ActionCompleted(ActionProcessor* processor,
AbstractAction* action,
ErrorCode code) {
@@ -109,10 +109,9 @@
const char* const kPayloadHashHex = "486173682b";
} // namespace
-bool OmahaResponseHandlerActionTest::DoTest(
- const OmahaResponse& in,
- const string& test_deadline_file,
- InstallPlan* out) {
+bool OmahaResponseHandlerActionTest::DoTest(const OmahaResponse& in,
+ const string& test_deadline_file,
+ InstallPlan* out) {
brillo::FakeMessageLoop loop(nullptr);
loop.SetAsCurrent();
ActionProcessor processor;
@@ -161,9 +160,9 @@
TEST_F(OmahaResponseHandlerActionTest, SimpleTest) {
string test_deadline_file;
- CHECK(utils::MakeTempFile(
- "omaha_response_handler_action_unittest-XXXXXX",
- &test_deadline_file, nullptr));
+ CHECK(utils::MakeTempFile("omaha_response_handler_action_unittest-XXXXXX",
+ &test_deadline_file,
+ nullptr));
ScopedPathUnlinker deadline_unlinker(test_deadline_file);
{
OmahaResponse in;
@@ -464,7 +463,8 @@
EXPECT_CALL(*fake_system_state_.mock_payload_state(), GetP2PUrl())
.WillRepeatedly(Return(p2p_url));
EXPECT_CALL(*fake_system_state_.mock_payload_state(),
- GetUsingP2PForDownloading()).WillRepeatedly(Return(true));
+ GetUsingP2PForDownloading())
+ .WillRepeatedly(Return(true));
InstallPlan install_plan;
EXPECT_TRUE(DoTest(in, "", &install_plan));
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index bdc0196..9684def 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -69,7 +69,7 @@
#if USE_LIBCROS
using org::chromium::LibCrosServiceInterfaceProxyMock;
using org::chromium::UpdateEngineLibcrosProxyResolvedInterfaceProxyMock;
-#endif // USE_LIBCROS
+#endif // USE_LIBCROS
using std::string;
using std::unique_ptr;
using testing::_;
diff --git a/update_manager/android_things_policy.cc b/update_manager/android_things_policy.cc
index 3af93cc..5fbda46 100644
--- a/update_manager/android_things_policy.cc
+++ b/update_manager/android_things_policy.cc
@@ -110,7 +110,6 @@
ApiRestrictedDownloadsPolicyImpl api_restricted_downloads_policy;
vector<Policy const*> policies_to_consult = {
-
// Do not apply the update if all updates are restricted by the API.
&api_restricted_downloads_policy,
};
diff --git a/update_manager/android_things_policy.h b/update_manager/android_things_policy.h
index b45e955..9fd8bc4 100644
--- a/update_manager/android_things_policy.h
+++ b/update_manager/android_things_policy.h
@@ -61,18 +61,18 @@
// P2P is always disabled. Returns |result|==|false| and
// |EvalStatus::kSucceeded|
- virtual EvalStatus P2PEnabled(EvaluationContext* ec,
- State* state,
- std::string* error,
- bool* result) const override;
+ EvalStatus P2PEnabled(EvaluationContext* ec,
+ State* state,
+ std::string* error,
+ bool* result) const override;
// This will return immediately with |EvalStatus::kSucceeded| and set
// |result|==|false|
- virtual EvalStatus P2PEnabledChanged(EvaluationContext* ec,
- State* state,
- std::string* error,
- bool* result,
- bool prev_result) const override;
+ EvalStatus P2PEnabledChanged(EvaluationContext* ec,
+ State* state,
+ std::string* error,
+ bool* result,
+ bool prev_result) const override;
protected:
// Policy override.
diff --git a/update_manager/android_things_policy_unittest.cc b/update_manager/android_things_policy_unittest.cc
index 04b0e0e..8a50bc2 100644
--- a/update_manager/android_things_policy_unittest.cc
+++ b/update_manager/android_things_policy_unittest.cc
@@ -16,6 +16,8 @@
#include "update_engine/update_manager/android_things_policy.h"
+#include <memory>
+
#include "update_engine/update_manager/next_update_check_policy_impl.h"
#include "update_engine/update_manager/policy_test_utils.h"
@@ -38,6 +40,7 @@
// For the purpose of the tests, this is an official build
fake_state_.system_provider()->var_is_official_build()->reset(
new bool(true));
+ // NOLINTNEXTLINE(readability/casting)
fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(2));
}
@@ -115,6 +118,7 @@
// UpdateCheckAllowed should return false (kSucceeded) if the image booted
// without enough slots to do A/B updates.
+ // NOLINTNEXTLINE(readability/casting)
fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(1));
UpdateCheckParams result;
diff --git a/update_manager/api_restricted_downloads_policy_impl.h b/update_manager/api_restricted_downloads_policy_impl.h
index 69686d6..21457a5 100644
--- a/update_manager/api_restricted_downloads_policy_impl.h
+++ b/update_manager/api_restricted_downloads_policy_impl.h
@@ -48,4 +48,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_API_RESTRICTED_DOWNLOADS_POLICY_IMPL_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_API_RESTRICTED_DOWNLOADS_POLICY_IMPL_H_
diff --git a/update_manager/boxed_value_unittest.cc b/update_manager/boxed_value_unittest.cc
index 83d8de7..4aeaec8 100644
--- a/update_manager/boxed_value_unittest.cc
+++ b/update_manager/boxed_value_unittest.cc
@@ -21,6 +21,7 @@
#include <map>
#include <set>
#include <string>
+#include <utility>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
diff --git a/update_manager/chromeos_policy_unittest.cc b/update_manager/chromeos_policy_unittest.cc
index 2cd2aa6..63fa0f7 100644
--- a/update_manager/chromeos_policy_unittest.cc
+++ b/update_manager/chromeos_policy_unittest.cc
@@ -93,6 +93,7 @@
new bool(true));
fake_state_.system_provider()->var_is_oobe_complete()->reset(
new bool(true));
+ // NOLINTNEXTLINE(readability/casting)
fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(2));
// Connection is wifi, untethered.
@@ -422,6 +423,7 @@
// UpdateCheckAllowed should return false (kSucceeded) if the image booted
// without enough slots to do A/B updates.
+ // NOLINTNEXTLINE(readability/casting)
fake_state_.system_provider()->var_num_slots()->reset(new unsigned int(1));
UpdateCheckParams result;
diff --git a/update_manager/enough_slots_ab_updates_policy_impl.h b/update_manager/enough_slots_ab_updates_policy_impl.h
index c0701f8..1d45389 100644
--- a/update_manager/enough_slots_ab_updates_policy_impl.h
+++ b/update_manager/enough_slots_ab_updates_policy_impl.h
@@ -46,4 +46,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_ENOUGH_SLOTS_AB_UPDATES_POLICY_IMPL_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_ENOUGH_SLOTS_AB_UPDATES_POLICY_IMPL_H_
diff --git a/update_manager/fake_updater_provider.h b/update_manager/fake_updater_provider.h
index 3e03d43..7295765 100644
--- a/update_manager/fake_updater_provider.h
+++ b/update_manager/fake_updater_provider.h
@@ -41,13 +41,9 @@
return &var_update_completed_time_;
}
- FakeVariable<double>* var_progress() override {
- return &var_progress_;
- }
+ FakeVariable<double>* var_progress() override { return &var_progress_; }
- FakeVariable<Stage>* var_stage() override {
- return &var_stage_;
- }
+ FakeVariable<Stage>* var_stage() override { return &var_stage_; }
FakeVariable<std::string>* var_new_version() override {
return &var_new_version_;
@@ -65,9 +61,7 @@
return &var_new_channel_;
}
- FakeVariable<bool>* var_p2p_enabled() override {
- return &var_p2p_enabled_;
- }
+ FakeVariable<bool>* var_p2p_enabled() override { return &var_p2p_enabled_; }
FakeVariable<bool>* var_cellular_enabled() override {
return &var_cellular_enabled_;
@@ -90,45 +84,30 @@
}
private:
- FakeVariable<base::Time>
- var_updater_started_time_{ // NOLINT(whitespace/braces)
- "updater_started_time", kVariableModePoll};
- FakeVariable<base::Time> var_last_checked_time_{ // NOLINT(whitespace/braces)
- "last_checked_time", kVariableModePoll};
- FakeVariable<base::Time>
- var_update_completed_time_{ // NOLINT(whitespace/braces)
- "update_completed_time", kVariableModePoll};
- FakeVariable<double> var_progress_{ // NOLINT(whitespace/braces)
- "progress", kVariableModePoll};
- FakeVariable<Stage> var_stage_{ // NOLINT(whitespace/braces)
- "stage", kVariableModePoll};
- FakeVariable<std::string> var_new_version_{ // NOLINT(whitespace/braces)
- "new_version", kVariableModePoll};
- FakeVariable<uint64_t> var_payload_size_{// NOLINT(whitespace/braces)
- "payload_size", kVariableModePoll};
- FakeVariable<std::string> var_curr_channel_{ // NOLINT(whitespace/braces)
- "curr_channel", kVariableModePoll};
- FakeVariable<std::string> var_new_channel_{ // NOLINT(whitespace/braces)
- "new_channel", kVariableModePoll};
- FakeVariable<bool> var_p2p_enabled_{// NOLINT(whitespace/braces)
- "p2p_enabled",
- kVariableModeAsync};
- FakeVariable<bool> var_cellular_enabled_{// NOLINT(whitespace/braces)
- "cellular_enabled",
+ FakeVariable<base::Time> var_updater_started_time_{"updater_started_time",
+ kVariableModePoll};
+ FakeVariable<base::Time> var_last_checked_time_{"last_checked_time",
+ kVariableModePoll};
+ FakeVariable<base::Time> var_update_completed_time_{"update_completed_time",
+ kVariableModePoll};
+ FakeVariable<double> var_progress_{"progress", kVariableModePoll};
+ FakeVariable<Stage> var_stage_{"stage", kVariableModePoll};
+ FakeVariable<std::string> var_new_version_{"new_version", kVariableModePoll};
+ FakeVariable<uint64_t> var_payload_size_{"payload_size", kVariableModePoll};
+ FakeVariable<std::string> var_curr_channel_{"curr_channel",
+ kVariableModePoll};
+ FakeVariable<std::string> var_new_channel_{"new_channel", kVariableModePoll};
+ FakeVariable<bool> var_p2p_enabled_{"p2p_enabled", kVariableModeAsync};
+ FakeVariable<bool> var_cellular_enabled_{"cellular_enabled",
kVariableModeAsync};
- FakeVariable<unsigned int>
- var_consecutive_failed_update_checks_{ // NOLINT(whitespace/braces)
- "consecutive_failed_update_checks", kVariableModePoll};
- FakeVariable<unsigned int>
- var_server_dictated_poll_interval_{ // NOLINT(whitespace/braces)
- "server_dictated_poll_interval", kVariableModePoll};
- FakeVariable<UpdateRequestStatus>
- var_forced_update_requested_{ // NOLINT(whitespace/braces)
- "forced_update_requested", kVariableModeAsync};
+ FakeVariable<unsigned int> var_consecutive_failed_update_checks_{
+ "consecutive_failed_update_checks", kVariableModePoll};
+ FakeVariable<unsigned int> var_server_dictated_poll_interval_{
+ "server_dictated_poll_interval", kVariableModePoll};
+ FakeVariable<UpdateRequestStatus> var_forced_update_requested_{
+ "forced_update_requested", kVariableModeAsync};
FakeVariable<UpdateRestrictions> var_update_restrictions_{
- // NOLINT(whitespace/braces)
- "update_restrictions",
- kVariableModePoll};
+ "update_restrictions", kVariableModePoll};
DISALLOW_COPY_AND_ASSIGN(FakeUpdaterProvider);
};
diff --git a/update_manager/interactive_update_policy_impl.h b/update_manager/interactive_update_policy_impl.h
index fc68ea3..a431456 100644
--- a/update_manager/interactive_update_policy_impl.h
+++ b/update_manager/interactive_update_policy_impl.h
@@ -46,4 +46,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/next_update_check_policy_impl.h b/update_manager/next_update_check_policy_impl.h
index d9f3c3b..291ea0f 100644
--- a/update_manager/next_update_check_policy_impl.h
+++ b/update_manager/next_update_check_policy_impl.h
@@ -95,4 +95,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_NEXT_UPDATE_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_NEXT_UPDATE_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/next_update_check_policy_impl_unittest.cc b/update_manager/next_update_check_policy_impl_unittest.cc
index ddc88e7..58aff66 100644
--- a/update_manager/next_update_check_policy_impl_unittest.cc
+++ b/update_manager/next_update_check_policy_impl_unittest.cc
@@ -16,6 +16,8 @@
#include "update_engine/update_manager/next_update_check_policy_impl.h"
+#include <memory>
+
#include "update_engine/update_manager/policy_test_utils.h"
using base::Time;
@@ -92,7 +94,7 @@
Time next_update_check;
fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
- new unsigned int(2));
+ new unsigned int{2});
ExpectStatus(EvalStatus::kSucceeded,
NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -117,10 +119,10 @@
const auto kInterval = policy_test_constants.timeout_periodic_interval * 4;
fake_state_.updater_provider()->var_server_dictated_poll_interval()->reset(
- new unsigned int(kInterval));
+ new unsigned int(kInterval)); // NOLINT(readability/casting)
// We should not be backing off in this case.
fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
- new unsigned int(2));
+ new unsigned int(2)); // NOLINT(readability/casting)
ExpectStatus(EvalStatus::kSucceeded,
&NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -139,7 +141,7 @@
Time next_update_check;
fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
- new unsigned int(100));
+ new unsigned int(100)); // NOLINT(readability/casting)
ExpectStatus(EvalStatus::kSucceeded,
&NextUpdateCheckTimePolicyImpl::NextUpdateCheckTime,
@@ -158,4 +160,4 @@
next_update_check);
}
-} // namespace chromeos_update_manager
\ No newline at end of file
+} // namespace chromeos_update_manager
diff --git a/update_manager/official_build_check_policy_impl.h b/update_manager/official_build_check_policy_impl.h
index deb81c3..6257209 100644
--- a/update_manager/official_build_check_policy_impl.h
+++ b/update_manager/official_build_check_policy_impl.h
@@ -46,4 +46,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_OFFICIAL_BUILD_CHECK_POLICY_IMPL_H_
diff --git a/update_manager/policy_test_utils.cc b/update_manager/policy_test_utils.cc
index dfeb2d4..fbfcb82 100644
--- a/update_manager/policy_test_utils.cc
+++ b/update_manager/policy_test_utils.cc
@@ -16,6 +16,7 @@
#include "update_engine/update_manager/policy_test_utils.h"
+#include <memory>
#include <tuple>
#include <vector>
@@ -53,9 +54,9 @@
fake_state_.updater_provider()->var_last_checked_time()->reset(
new Time(fake_clock_.GetWallclockTime()));
fake_state_.updater_provider()->var_consecutive_failed_update_checks()->reset(
- new unsigned int(0));
+ new unsigned int(0)); // NOLINT(readability/casting)
fake_state_.updater_provider()->var_server_dictated_poll_interval()->reset(
- new unsigned int(0));
+ new unsigned int(0)); // NOLINT(readability/casting)
fake_state_.updater_provider()->var_forced_update_requested()->reset(
new UpdateRequestStatus{UpdateRequestStatus::kNone});
@@ -106,4 +107,4 @@
return update_state;
}
-} // namespace chromeos_update_manager
\ No newline at end of file
+} // namespace chromeos_update_manager
diff --git a/update_manager/policy_test_utils.h b/update_manager/policy_test_utils.h
index 09b2550..5b93f7b 100644
--- a/update_manager/policy_test_utils.h
+++ b/update_manager/policy_test_utils.h
@@ -17,6 +17,7 @@
#ifndef UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
#define UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
+#include <memory>
#include <string>
#include <base/time/time.h>
@@ -32,7 +33,7 @@
class UmPolicyTestBase : public ::testing::Test {
protected:
- explicit UmPolicyTestBase() = default;
+ UmPolicyTestBase() = default;
void SetUp() override;
@@ -95,4 +96,4 @@
} // namespace chromeos_update_manager
-#endif // UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
\ No newline at end of file
+#endif // UPDATE_ENGINE_UPDATE_MANAGER_POLICY_TEST_UTILS_H_
diff --git a/update_manager/policy_utils.h b/update_manager/policy_utils.h
index e448022..eaf9ee9 100644
--- a/update_manager/policy_utils.h
+++ b/update_manager/policy_utils.h
@@ -17,6 +17,9 @@
#ifndef UPDATE_ENGINE_UPDATE_MANAGER_POLICY_UTILS_H_
#define UPDATE_ENGINE_UPDATE_MANAGER_POLICY_UTILS_H_
+#include <string>
+#include <vector>
+
#include "update_engine/update_manager/policy.h"
// Checks that the passed pointer value is not null, returning kFailed on the
@@ -57,7 +60,7 @@
}
}
return EvalStatus::kContinue;
-};
+}
// Base class implementation that returns |EvalStatus::kContinue| for all
// decisions, to be used as a base-class for various Policy facets that only