From bda12a1b239235de0169b14760214e43f839bed8 Mon Sep 17 00:00:00 2001 From: ccalvarin Date: Thu, 21 Jun 2018 18:57:26 -0700 Subject: 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 --- .../com/google/devtools/build/lib/skyframe/FileFunctionTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java') 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); } -- cgit v1.2.3