|
|
@ -614,7 +614,7 @@ TEST_F(UnknownFieldSetTest, DeleteSubrange) { |
|
|
|
|
|
|
|
|
|
|
|
void CheckDeleteByNumber(const std::vector<int>& field_numbers, |
|
|
|
void CheckDeleteByNumber(const std::vector<int>& field_numbers, |
|
|
|
int deleted_number, |
|
|
|
int deleted_number, |
|
|
|
const std::vector<int>& expected_field_nubmers) { |
|
|
|
const std::vector<int>& expected_field_numbers) { |
|
|
|
UnknownFieldSet unknown_fields; |
|
|
|
UnknownFieldSet unknown_fields; |
|
|
|
for (int i = 0; i < field_numbers.size(); ++i) { |
|
|
|
for (int i = 0; i < field_numbers.size(); ++i) { |
|
|
|
unknown_fields.AddFixed32(field_numbers[i], i); |
|
|
|
unknown_fields.AddFixed32(field_numbers[i], i); |
|
|
@ -622,7 +622,7 @@ void CheckDeleteByNumber(const std::vector<int>& field_numbers, |
|
|
|
unknown_fields.DeleteByNumber(deleted_number); |
|
|
|
unknown_fields.DeleteByNumber(deleted_number); |
|
|
|
ASSERT_EQ(expected_field_nubmers.size(), unknown_fields.field_count()); |
|
|
|
ASSERT_EQ(expected_field_nubmers.size(), unknown_fields.field_count()); |
|
|
|
for (int i = 0; i < expected_field_nubmers.size(); ++i) { |
|
|
|
for (int i = 0; i < expected_field_nubmers.size(); ++i) { |
|
|
|
EXPECT_EQ(expected_field_nubmers[i], unknown_fields.field(i).number()); |
|
|
|
EXPECT_EQ(expected_field_numbers[i], unknown_fields.field(i).number()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|