aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-05-30 17:00:48 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-05-31 09:18:22 +0200
commit78cfa8d1977036452f45838f739cc53debf8a615 (patch)
tree1a7aa946715e7d1b764955f3ee857ef435295ec0 /src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
parenta1fb6f26cfeaa712f447e5d41d2a98565e9ab478 (diff)
Migrate most of the assertions to Truth that the auto-migration tool did not catch.
IntelliJ's "replace structurally" command was surprisingly useful. RELNOTES: None. PiperOrigin-RevId: 157463734
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
index fb8ebbbe8f..fdd13b07f1 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java
@@ -15,8 +15,6 @@
package com.google.devtools.build.lib.rules.cpp;
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.common.base.Joiner;
@@ -386,17 +384,17 @@ public class CppLinkActionTest extends BuildViewTestCase {
CppHelper.getToolchainUsingDefaultCcToolchainAttribute(ruleContext),
CppHelper.getFdoSupportUsingDefaultCcToolchainAttribute(ruleContext));
builder.setLinkType(LinkTargetType.STATIC_LIBRARY);
- assertTrue(builder.canSplitCommandLine());
+ assertThat(builder.canSplitCommandLine()).isTrue();
builder.setLinkType(LinkTargetType.DYNAMIC_LIBRARY);
- assertTrue(builder.canSplitCommandLine());
+ assertThat(builder.canSplitCommandLine()).isTrue();
builder.setInterfaceOutput(outputIfso);
- assertFalse(builder.canSplitCommandLine());
+ assertThat(builder.canSplitCommandLine()).isFalse();
builder.setInterfaceOutput(null);
builder.setLinkType(LinkTargetType.INTERFACE_DYNAMIC_LIBRARY);
- assertFalse(builder.canSplitCommandLine());
+ assertThat(builder.canSplitCommandLine()).isFalse();
}
/**
@@ -426,11 +424,11 @@ public class CppLinkActionTest extends BuildViewTestCase {
CppLinkAction linkAction =
createLinkBuilder(
- Link.LinkTargetType.EXECUTABLE,
- "dummyRuleContext/binary2",
- objects.build(),
- ImmutableList.<LibraryToLink>of(),
- new FeatureConfiguration())
+ Link.LinkTargetType.EXECUTABLE,
+ "dummyRuleContext/binary2",
+ objects.build(),
+ ImmutableList.<LibraryToLink>of(),
+ new FeatureConfiguration())
.setFake(true)
.build();
@@ -451,12 +449,12 @@ public class CppLinkActionTest extends BuildViewTestCase {
);
// Ensure that anything above the minimum is properly scaled.
- assertTrue(resources.getMemoryMb() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getMemoryMb()
- || resources.getMemoryMb() == scaledSet.getMemoryMb());
- assertTrue(resources.getCpuUsage() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getCpuUsage()
- || resources.getCpuUsage() == scaledSet.getCpuUsage());
- assertTrue(resources.getIoUsage() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getIoUsage()
- || resources.getIoUsage() == scaledSet.getIoUsage());
+ assertThat(resources.getMemoryMb() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getMemoryMb()
+ || resources.getMemoryMb() == scaledSet.getMemoryMb()).isTrue();
+ assertThat(resources.getCpuUsage() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getCpuUsage()
+ || resources.getCpuUsage() == scaledSet.getCpuUsage()).isTrue();
+ assertThat(resources.getIoUsage() == CppLinkAction.MIN_STATIC_LINK_RESOURCES.getIoUsage()
+ || resources.getIoUsage() == scaledSet.getIoUsage()).isTrue();
}
private CppLinkActionBuilder createLinkBuilder(