aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/util
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-07-27 12:46:46 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-27 12:48:22 -0700
commitc9efd06dc6cfef400b288becf96aed1f5ba228b2 (patch)
tree076142a5a53677d2a3a7c22ffbee90a95f7becca /src/test/java/com/google/devtools/build/lib/util
parent0ae0be980ebdd0e47bdc72b122d5074d4c3d0cb5 (diff)
Automated rollback of commit 7e87730de985b7099b9b683571d58efdaab70890.
*** Reason for rollback *** Go back to the default constructor - instead of requiring everywhere to know the correct hash function, we'll have the default rely on global state. It will make transition easier, even if it makes the origin of the hash less obvious. *** Original change description *** Remove default MD5 in most of Bazel's virtual filesystems. This forces the ex-default to be explicit in a lot of tests, but I'd rather that than have the risk of implicit md5-use in production code. To keep this CL smaller, do not remove the default from UnixFS quite yet. RELNOTES: None. PiperOrigin-RevId: 206358838
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/util')
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/FileTypeTest.java3
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/FingerprintTest.java3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/util/FileTypeTest.java b/src/test/java/com/google/devtools/build/lib/util/FileTypeTest.java
index fa6faf8353..9662ca5fa6 100644
--- a/src/test/java/com/google/devtools/build/lib/util/FileTypeTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/FileTypeTest.java
@@ -19,7 +19,6 @@ import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.util.FileType.HasFileType;
-import com.google.devtools.build.lib.vfs.DigestHashFunction;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
@@ -84,7 +83,7 @@ public class FileTypeTest {
@Test
public void handlesPathObjects() {
- Path readme = new InMemoryFileSystem(DigestHashFunction.MD5).getPath("/readme.txt");
+ Path readme = new InMemoryFileSystem().getPath("/readme.txt");
assertThat(TEXT.matches(readme)).isTrue();
}
diff --git a/src/test/java/com/google/devtools/build/lib/util/FingerprintTest.java b/src/test/java/com/google/devtools/build/lib/util/FingerprintTest.java
index c5dd670344..372b48d80c 100644
--- a/src/test/java/com/google/devtools/build/lib/util/FingerprintTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/FingerprintTest.java
@@ -18,7 +18,6 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.clock.BlazeClock;
-import com.google.devtools.build.lib.vfs.DigestHashFunction;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
@@ -117,7 +116,7 @@ public class FingerprintTest {
PathFragment pf = PathFragment.create("/etc/pwd");
assertThat(new Fingerprint().addPath(pf).hexDigestAndReset())
.isEqualTo("63ab5c47c117635407a1af6377e216bc");
- Path p = new InMemoryFileSystem(BlazeClock.instance(), DigestHashFunction.MD5).getPath(pf);
+ Path p = new InMemoryFileSystem(BlazeClock.instance()).getPath(pf);
assertThat(new Fingerprint().addPath(p).hexDigestAndReset())
.isEqualTo("63ab5c47c117635407a1af6377e216bc");
}