diff options
author | 2017-03-20 16:00:51 +0000 | |
---|---|---|
committer | 2017-03-21 12:48:48 +0000 | |
commit | 14db507c284a936dc14559f095a4629d5c52f5d8 (patch) | |
tree | 16529521638a0984463db7cb53071a40671eab75 /src/test | |
parent | 41ac1e041484205f1558f30fb5ff75e15acbe39e (diff) |
Add ActionInput.getExecPath, which returns a PathFragment
Update some callers to use getExecPath, which generally results in less
intermediate garbage generation (almost all callers need a PathFragment, not
a String).
Another small step towards #1593.
--
PiperOrigin-RevId: 150631279
MOS_MIGRATED_REVID=150631279
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/exec/DigestTest.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/exec/DigestTest.java b/src/test/java/com/google/devtools/build/lib/exec/DigestTest.java index b610641144..27edca06d2 100644 --- a/src/test/java/com/google/devtools/build/lib/exec/DigestTest.java +++ b/src/test/java/com/google/devtools/build/lib/exec/DigestTest.java @@ -23,6 +23,7 @@ import com.google.devtools.build.lib.actions.cache.VirtualActionInput; import com.google.devtools.build.lib.testutil.Suite; import com.google.devtools.build.lib.testutil.TestSpec; import com.google.devtools.build.lib.util.Pair; +import com.google.devtools.build.lib.vfs.PathFragment; import com.google.protobuf.ByteString; import java.io.IOException; import java.io.OutputStream; @@ -61,7 +62,7 @@ public class DigestTest { "8b1a9953c4611296a827abf8c47804d7", Digest.fromContent("Hello".getBytes(UTF_8)).toStringUtf8()); - assertEquals(UGLY_DIGEST, Digest.fromContent(UGLY.getBytes()).toStringUtf8()); + assertEquals(UGLY_DIGEST, Digest.fromContent(UGLY.getBytes(UTF_8)).toStringUtf8()); // ByteBuffer digest not idempotent because ByteBuffer manages a "position" internally. ByteBuffer buffer = ByteBuffer.wrap(UGLY.getBytes(UTF_8)); @@ -106,6 +107,11 @@ public class DigestTest { public String getExecPathString() { throw new UnsupportedOperationException(); } + + @Override + public PathFragment getExecPath() { + throw new UnsupportedOperationException(); + } }); assertEquals(UGLY_DIGEST, result.first.toStringUtf8()); assertEquals(UGLY.length(), result.second.longValue()); |