Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java
diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java
similarity index 84%
copy from third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java
copy to third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java
index 0ef414aac60fa7ef5e4f9cae020f47655ac77d66..e21e038993251498308f26e1c134d8a8bf33fa54 100644
--- a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/LazyStringEndToEndTest.java
+++ b/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/LazyStringEndToEndTest.java
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -28,7 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-package com.google.protobuf;
+package com.google.protobuf.test;
+import com.google.protobuf.*;
import protobuf_unittest.UnittestProto;
@@ -89,31 +90,6 @@ public class LazyStringEndToEndTest extends TestCase {
TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8,
ByteString.copyFrom(sink));
}
-
- public void testCaching() {
- String a = "a";
- String b = "b";
- String c = "c";
- UnittestProto.TestAllTypes proto = UnittestProto.TestAllTypes.newBuilder()
- .setOptionalString(a)
- .addRepeatedString(b)
- .addRepeatedString(c)
- .build();
-
- // String should be the one we passed it.
- assertSame(a, proto.getOptionalString());
- assertSame(b, proto.getRepeatedString(0));
- assertSame(c, proto.getRepeatedString(1));
-
-
- // Ensure serialization keeps strings cached.
- proto.toByteString();
-
- // And now the string should stay cached.
- assertSame(a, proto.getOptionalString());
- assertSame(b, proto.getRepeatedString(0));
- assertSame(c, proto.getRepeatedString(1));
- }
public void testNoStringCachingIfOnlyBytesAccessed() throws Exception {
UnittestProto.TestAllTypes proto =

Powered by Google App Engine
This is Rietveld 408576698