| Index: third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java
|
| diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java
|
| index 08b2a76d925e07b7eb52599036a4b344a941f453..d4a18a22ba612e88ab18ebabf6c79bdc23fc070f 100644
|
| --- a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java
|
| +++ b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java
|
| @@ -232,12 +232,10 @@ import protobuf_unittest.UnittestProto.TestOneof2;
|
| import protobuf_unittest.UnittestProto.TestPackedExtensions;
|
| import protobuf_unittest.UnittestProto.TestPackedTypes;
|
| import protobuf_unittest.UnittestProto.TestUnpackedTypes;
|
| -
|
| -import junit.framework.Assert;
|
| -
|
| import java.io.File;
|
| import java.io.IOException;
|
| import java.io.RandomAccessFile;
|
| +import junit.framework.Assert;
|
|
|
| /**
|
| * Contains methods for setting all fields of {@code TestAllTypes} to
|
| @@ -260,6 +258,13 @@ public final class TestUtil {
|
| }
|
|
|
| /**
|
| + * Dirties the message by resetting the momoized serialized size.
|
| + */
|
| + public static void resetMemoizedSize(AbstractMessage message) {
|
| + message.memoizedSize = -1;
|
| + }
|
| +
|
| + /**
|
| * Get a {@code TestAllTypes} with all fields set as they would be by
|
| * {@link #setAllFields(TestAllTypes.Builder)}.
|
| */
|
| @@ -3764,7 +3769,8 @@ public final class TestUtil {
|
|
|
| private static File getTestDataDir() {
|
| // Search each parent directory looking for "src/google/protobuf".
|
| - File ancestor = new File(".");
|
| + File ancestor = new File(System.getProperty("protobuf.dir", "."));
|
| + String initialPath = ancestor.getAbsolutePath();
|
| try {
|
| ancestor = ancestor.getCanonicalFile();
|
| } catch (IOException e) {
|
| @@ -3781,7 +3787,7 @@ public final class TestUtil {
|
| throw new RuntimeException(
|
| "Could not find golden files. This test must be run from within the " +
|
| "protobuf source package so that it can read test data files from the " +
|
| - "C++ source tree.");
|
| + "C++ source tree: " + initialPath);
|
| }
|
|
|
| /**
|
|
|