diff options
author | michajlo <michajlo@google.com> | 2018-03-26 20:53:04 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-26 20:54:37 -0700 |
commit | b8765a6656415eb6380fffd20202515918880d96 (patch) | |
tree | 8a629f6b8c998206578df76cb9f78ae01451abb2 /src/test/java/com | |
parent | 327c74df7c3b4820a0620bf9696c3f88bffebda3 (diff) |
Remove FastStringCodec
Currently unnecessary
PiperOrigin-RevId: 190568226
Diffstat (limited to 'src/test/java/com')
2 files changed, 0 insertions, 89 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/FastStringCodecTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/FastStringCodecTest.java deleted file mode 100644 index c0ae7d02ee..0000000000 --- a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/FastStringCodecTest.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.skyframe.serialization.strings; - -import com.google.common.testing.EqualsTester; -import com.google.devtools.build.lib.skyframe.serialization.testutils.ObjectCodecTester; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Tests for {@link FastStringCodec}. */ -@RunWith(JUnit4.class) -public class FastStringCodecTest { - - @Test - public void testCodec() throws Exception { - if (!FastStringCodec.isAvailable()) { - // Not available on this platform, skip test. - return; - } - - ObjectCodecTester.newBuilder(new FastStringCodec()) - .verificationFunction( - (original, deserialized) -> { - // hashCode is stored in String. Because we're using Unsafe to bypass standard String - // constructors, make sure it still works. - new EqualsTester().addEqualityGroup(original, deserialized).testEquals(); - }) - .addSubjects( - "ow now brown cow. ow now brown cow", - "(╯°□°)╯︵┻━┻ string with utf8/ascii", - "string with ascii/utf8 (╯°□°)╯︵┻━┻", - "last character utf8 ╯", - "last char only non-ascii ƒ", - "ƒ", - "╯", - "", - Character.toString((char) 0xc3)) - .buildAndRunTests(); - } -} diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/StringCodecsTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/StringCodecsTest.java deleted file mode 100644 index 52c50fc8ab..0000000000 --- a/src/test/java/com/google/devtools/build/lib/skyframe/serialization/strings/StringCodecsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2017 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.skyframe.serialization.strings; - -import static com.google.common.truth.Truth.assertThat; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** {@link StringCodecs} tests */ -@RunWith(JUnit4.class) -public class StringCodecsTest { - - @Test - public void testUsesFastStringCodecIfAvailable() { - if (FastStringCodec.isAvailable()) { - assertThat(StringCodecs.asciiOptimized()).isInstanceOf(FastStringCodec.class); - } else { - assertThat(StringCodecs.asciiOptimized()).isSameAs(StringCodecs.simple()); - } - } - -} |