Use InstallOperation::Type instead of InstallOperation_Type.
Test: mma
Change-Id: I4d23856904eab70ece686fe571c2db517b60835b
diff --git a/payload_generator/ab_generator.cc b/payload_generator/ab_generator.cc
index f4cc9fb..d9b9d88 100644
--- a/payload_generator/ab_generator.cc
+++ b/payload_generator/ab_generator.cc
@@ -276,7 +276,7 @@
target_part_path, dst_extents, &data, data.size(), kBlockSize));
brillo::Blob blob;
- InstallOperation_Type op_type;
+ InstallOperation::Type op_type;
TEST_AND_RETURN_FALSE(
diff_utils::GenerateBestFullOperation(data, version, &blob, &op_type));
diff --git a/payload_generator/ab_generator_unittest.cc b/payload_generator/ab_generator_unittest.cc
index 2f8c0c6..270657a 100644
--- a/payload_generator/ab_generator_unittest.cc
+++ b/payload_generator/ab_generator_unittest.cc
@@ -49,7 +49,7 @@
}
// Tests splitting of a REPLACE/REPLACE_BZ operation.
-void TestSplitReplaceOrReplaceBzOperation(InstallOperation_Type orig_type,
+void TestSplitReplaceOrReplaceBzOperation(InstallOperation::Type orig_type,
bool compressible) {
const size_t op_ex1_start_block = 2;
const size_t op_ex1_num_blocks = 2;
@@ -124,7 +124,7 @@
version, aop, part_file.path(), &result_ops, &blob_file));
// Check the result.
- InstallOperation_Type expected_type =
+ InstallOperation::Type expected_type =
compressible ? InstallOperation::REPLACE_BZ : InstallOperation::REPLACE;
ASSERT_EQ(2U, result_ops.size());
@@ -200,7 +200,7 @@
}
// Tests merging of REPLACE/REPLACE_BZ operations.
-void TestMergeReplaceOrReplaceBzOperations(InstallOperation_Type orig_type,
+void TestMergeReplaceOrReplaceBzOperations(InstallOperation::Type orig_type,
bool compressible) {
const size_t first_op_num_blocks = 1;
const size_t second_op_num_blocks = 2;
@@ -287,7 +287,7 @@
&aops, version, 5, part_file.path(), &blob_file));
// Check the result.
- InstallOperation_Type expected_op_type =
+ InstallOperation::Type expected_op_type =
compressible ? InstallOperation::REPLACE_BZ : InstallOperation::REPLACE;
EXPECT_EQ(1U, aops.size());
InstallOperation new_op = aops[0].op;
diff --git a/payload_generator/cycle_breaker.cc b/payload_generator/cycle_breaker.cc
index d76f679..d6eeed2 100644
--- a/payload_generator/cycle_breaker.cc
+++ b/payload_generator/cycle_breaker.cc
@@ -56,7 +56,7 @@
skipped_ops_ = 0;
for (Graph::size_type i = 0; i < subgraph_.size(); i++) {
- InstallOperation_Type op_type = graph[i].aop.op.type();
+ InstallOperation::Type op_type = graph[i].aop.op.type();
if (op_type == InstallOperation::REPLACE ||
op_type == InstallOperation::REPLACE_BZ) {
skipped_ops_++;
diff --git a/payload_generator/delta_diff_utils.cc b/payload_generator/delta_diff_utils.cc
index 1bad4d7..4ba6e24 100644
--- a/payload_generator/delta_diff_utils.cc
+++ b/payload_generator/delta_diff_utils.cc
@@ -760,7 +760,7 @@
bool GenerateBestFullOperation(const brillo::Blob& new_data,
const PayloadVersion& version,
brillo::Blob* out_blob,
- InstallOperation_Type* out_type) {
+ InstallOperation::Type* out_type) {
if (new_data.empty())
return false;
@@ -863,7 +863,7 @@
// Try generating a full operation for the given new data, regardless of the
// old_data.
- InstallOperation_Type op_type;
+ InstallOperation::Type op_type;
TEST_AND_RETURN_FALSE(
GenerateBestFullOperation(new_data, version, &data_blob, &op_type));
operation.set_type(op_type);
@@ -892,7 +892,7 @@
ScopedPathUnlinker unlinker(patch.value());
std::unique_ptr<bsdiff::PatchWriterInterface> bsdiff_patch_writer;
- InstallOperation_Type operation_type = InstallOperation::BSDIFF;
+ InstallOperation::Type operation_type = InstallOperation::BSDIFF;
if (version.OperationAllowed(InstallOperation::BROTLI_BSDIFF)) {
bsdiff_patch_writer =
bsdiff::CreateBSDF2PatchWriter(patch.value(),
@@ -1010,13 +1010,13 @@
return true;
}
-bool IsAReplaceOperation(InstallOperation_Type op_type) {
+bool IsAReplaceOperation(InstallOperation::Type op_type) {
return (op_type == InstallOperation::REPLACE ||
op_type == InstallOperation::REPLACE_BZ ||
op_type == InstallOperation::REPLACE_XZ);
}
-bool IsNoSourceOperation(InstallOperation_Type op_type) {
+bool IsNoSourceOperation(InstallOperation::Type op_type) {
return (IsAReplaceOperation(op_type) || op_type == InstallOperation::ZERO ||
op_type == InstallOperation::DISCARD);
}
diff --git a/payload_generator/delta_diff_utils.h b/payload_generator/delta_diff_utils.h
index 2306572..2211b30 100644
--- a/payload_generator/delta_diff_utils.h
+++ b/payload_generator/delta_diff_utils.h
@@ -119,13 +119,13 @@
bool GenerateBestFullOperation(const brillo::Blob& new_data,
const PayloadVersion& version,
brillo::Blob* out_blob,
- InstallOperation_Type* out_type);
+ InstallOperation::Type* out_type);
// Returns whether |op_type| is one of the REPLACE full operations.
-bool IsAReplaceOperation(InstallOperation_Type op_type);
+bool IsAReplaceOperation(InstallOperation::Type op_type);
// Returns true if an operation with type |op_type| has no |src_extents|.
-bool IsNoSourceOperation(InstallOperation_Type op_type);
+bool IsNoSourceOperation(InstallOperation::Type op_type);
// Returns true if |op| is a no-op operation that doesn't do any useful work
// (e.g., a move operation that copies blocks onto themselves).
diff --git a/payload_generator/delta_diff_utils_unittest.cc b/payload_generator/delta_diff_utils_unittest.cc
index f730cc9..b2950e8 100644
--- a/payload_generator/delta_diff_utils_unittest.cc
+++ b/payload_generator/delta_diff_utils_unittest.cc
@@ -390,7 +390,7 @@
EXPECT_FALSE(data.empty());
EXPECT_TRUE(op.has_type());
- const InstallOperation_Type expected_type =
+ const InstallOperation::Type expected_type =
(i == 0 ? InstallOperation::REPLACE : InstallOperation::REPLACE_BZ);
EXPECT_EQ(expected_type, op.type());
EXPECT_FALSE(op.has_data_offset());
diff --git a/payload_generator/full_update_generator.cc b/payload_generator/full_update_generator.cc
index 4d8b2f9..94a43ab 100644
--- a/payload_generator/full_update_generator.cc
+++ b/payload_generator/full_update_generator.cc
@@ -99,7 +99,7 @@
fd_, buffer_in_.data(), buffer_in_.size(), offset_, &bytes_read));
TEST_AND_RETURN_FALSE(bytes_read == static_cast<ssize_t>(size_));
- InstallOperation_Type op_type;
+ InstallOperation::Type op_type;
TEST_AND_RETURN_FALSE(diff_utils::GenerateBestFullOperation(
buffer_in_, version_, &op_blob, &op_type));
diff --git a/payload_generator/inplace_generator.cc b/payload_generator/inplace_generator.cc
index ee19b62..d553cc4 100644
--- a/payload_generator/inplace_generator.cc
+++ b/payload_generator/inplace_generator.cc
@@ -273,7 +273,7 @@
vector<Vertex::Index> full_ops;
ret.reserve(op_indexes->size());
for (auto op_index : *op_indexes) {
- InstallOperation_Type type = (*graph)[op_index].aop.op.type();
+ InstallOperation::Type type = (*graph)[op_index].aop.op.type();
if (type == InstallOperation::REPLACE ||
type == InstallOperation::REPLACE_BZ) {
full_ops.push_back(op_index);
diff --git a/payload_generator/inplace_generator_unittest.cc b/payload_generator/inplace_generator_unittest.cc
index ab3b867..8028f36 100644
--- a/payload_generator/inplace_generator_unittest.cc
+++ b/payload_generator/inplace_generator_unittest.cc
@@ -55,7 +55,7 @@
const vector<Extent>& src_extents,
const vector<Extent>& dst_extents,
const string& path,
- InstallOperation_Type type) {
+ InstallOperation::Type type) {
out->aop.op.set_type(type);
out->aop.name = path;
StoreExtents(src_extents, out->aop.op.mutable_src_extents());
diff --git a/payload_generator/payload_file.cc b/payload_generator/payload_file.cc
index 085ea16..a111fd6 100644
--- a/payload_generator/payload_file.cc
+++ b/payload_generator/payload_file.cc
@@ -365,15 +365,15 @@
const DeltaObject& object = object_count.first;
// Use printf() instead of LOG(INFO) because timestamp makes it difficult to
// compare two reports.
- printf(
- kFormatString,
- object.size * 100.0 / total_size,
- object.size,
- (object.type >= 0 ? InstallOperationTypeName(
- static_cast<InstallOperation_Type>(object.type))
- : "-"),
- object.name.c_str(),
- object_count.second);
+ printf(kFormatString,
+ object.size * 100.0 / total_size,
+ object.size,
+ (object.type >= 0
+ ? InstallOperationTypeName(
+ static_cast<InstallOperation::Type>(object.type))
+ : "-"),
+ object.name.c_str(),
+ object_count.second);
}
printf(kFormatString, 100.0, total_size, "", "<total>", total_op);
fflush(stdout);
diff --git a/payload_generator/payload_generation_config.cc b/payload_generator/payload_generation_config.cc
index 694c71f..648fe8b 100644
--- a/payload_generator/payload_generation_config.cc
+++ b/payload_generator/payload_generation_config.cc
@@ -222,7 +222,7 @@
return true;
}
-bool PayloadVersion::OperationAllowed(InstallOperation_Type operation) const {
+bool PayloadVersion::OperationAllowed(InstallOperation::Type operation) const {
switch (operation) {
// Full operations:
case InstallOperation::REPLACE:
diff --git a/payload_generator/payload_generation_config.h b/payload_generator/payload_generation_config.h
index 2153ab0..584ac7b 100644
--- a/payload_generator/payload_generation_config.h
+++ b/payload_generator/payload_generation_config.h
@@ -165,7 +165,7 @@
bool Validate() const;
// Return whether the passed |operation| is allowed by this payload.
- bool OperationAllowed(InstallOperation_Type operation) const;
+ bool OperationAllowed(InstallOperation::Type operation) const;
// Whether this payload version is a delta payload.
bool IsDelta() const;