diff options
author | 2018-06-21 18:57:26 -0700 | |
---|---|---|
committer | 2018-06-21 18:59:08 -0700 | |
commit | bda12a1b239235de0169b14760214e43f839bed8 (patch) | |
tree | ad47596f2e0d52dbaf7faf1fb7239145cbaa8b8f /src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java | |
parent | a8d7357b7dc66e0531c298e4d369e6342fcf94b7 (diff) |
Move HashFunction out of FileSystem, and turn it into a class, instead of an enum.
Now that we aren't using enum names for the hash functions, we also accept the standard names, such as SHA-256.
RELNOTES: None.
PiperOrigin-RevId: 201624286
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java index 390436b0c7..f583465cda 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java @@ -52,6 +52,7 @@ import com.google.devtools.build.lib.testutil.TestRuleClassProvider; import com.google.devtools.build.lib.testutil.TestUtils; import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor; +import com.google.devtools.build.lib.vfs.DigestHashFunction; import com.google.devtools.build.lib.vfs.FileStatus; import com.google.devtools.build.lib.vfs.FileSystem; import com.google.devtools.build.lib.vfs.FileSystemUtils; @@ -451,7 +452,7 @@ public class FileFunctionTest { createFsAndRoot( new CustomInMemoryFs(manualClock) { @Override - protected byte[] getFastDigest(Path path, HashFunction hf) throws IOException { + protected byte[] getFastDigest(Path path, DigestHashFunction hf) throws IOException { return digest; } }); @@ -490,7 +491,7 @@ public class FileFunctionTest { createFsAndRoot( new CustomInMemoryFs(manualClock) { @Override - protected byte[] getFastDigest(Path path, HashFunction hf) { + protected byte[] getFastDigest(Path path, DigestHashFunction hf) { return path.getBaseName().equals("unreadable") ? expectedDigest : null; } }); @@ -826,7 +827,7 @@ public class FileFunctionTest { fs = new CustomInMemoryFs(manualClock) { @Override - protected byte[] getDigest(Path path, HashFunction hf) throws IOException { + protected byte[] getDigest(Path path, DigestHashFunction hf) throws IOException { digestCalls.incrementAndGet(); return super.getDigest(path, hf); } @@ -1686,7 +1687,7 @@ public class FileFunctionTest { } @Override - protected byte[] getFastDigest(Path path, HashFunction hashFunction) throws IOException { + protected byte[] getFastDigest(Path path, DigestHashFunction hashFunction) throws IOException { if (stubbedFastDigestErrors.containsKey(path)) { throw stubbedFastDigestErrors.get(path); } |