|
|
@ -1386,6 +1386,7 @@ TEST(RepeatedPtrField, ClearedElements) { |
|
|
|
field.Clear(); |
|
|
|
field.Clear(); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 2); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 2); |
|
|
|
#ifndef PROTOBUF_FUTURE_REMOVE_CLEARED_API |
|
|
|
#ifndef PROTOBUF_FUTURE_REMOVE_CLEARED_API |
|
|
|
|
|
|
|
PROTOBUF_IGNORE_DEPRECATION_START |
|
|
|
EXPECT_EQ(field.ReleaseCleared(), original); // Take ownership again.
|
|
|
|
EXPECT_EQ(field.ReleaseCleared(), original); // Take ownership again.
|
|
|
|
EXPECT_EQ(field.ClearedCount(), 1); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 1); |
|
|
|
EXPECT_NE(field.Add(), original); |
|
|
|
EXPECT_NE(field.Add(), original); |
|
|
@ -1397,6 +1398,7 @@ TEST(RepeatedPtrField, ClearedElements) { |
|
|
|
EXPECT_EQ(field.ClearedCount(), 1); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 1); |
|
|
|
EXPECT_EQ(field.Add(), original); |
|
|
|
EXPECT_EQ(field.Add(), original); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 0); |
|
|
|
EXPECT_EQ(field.ClearedCount(), 0); |
|
|
|
|
|
|
|
PROTOBUF_IGNORE_DEPRECATION_STOP |
|
|
|
#endif // !PROTOBUF_FUTURE_REMOVE_CLEARED_API
|
|
|
|
#endif // !PROTOBUF_FUTURE_REMOVE_CLEARED_API
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|