diff options
author | Googler <noreply@google.com> | 2017-05-19 13:54:06 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-05-19 15:08:15 +0200 |
commit | 2633a599532e73f8f66d346b40b6c06896bab0dd (patch) | |
tree | b5e042d682f23f72abd591ce0e1318da72d9b1b7 /src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java | |
parent | 113ffef65ac73eb530e095282d5d8c909f26100f (diff) |
Fixes incorrectly-ordered arguments to calls to assertEquals
[]
This change has been automatically generated by an Error Prone check that
detects incorrect argument ordering on calls to assertEquals-style methods. See
[]
Cleanup change automatically generated by javacflume/refactory
Refactoring: third_party/java_src/error_prone/project/core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects:AssertEqualsArgumentOrderChecker_refactoring
Tested:
TAP --sample for global presubmit queue
[]
PiperOrigin-RevId: 156539781
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java index 422ae46a79..e6175a890c 100644 --- a/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java +++ b/src/test/java/com/google/devtools/build/lib/profiler/ProfilerTest.java @@ -28,12 +28,6 @@ import com.google.devtools.build.lib.util.BlazeClock; import com.google.devtools.build.lib.util.Clock; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; @@ -42,6 +36,10 @@ import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Unit tests for the profiler. @@ -133,17 +131,17 @@ public class ProfilerTest extends FoundationTestCase { count++; } } - assertEquals(count, 2); // only children are GENERIC and ACTION_CHECK + assertEquals(2, count); // only children are GENERIC and ACTION_CHECK assertEquals(task.aggregatedStats.toArray().length, ProfilerTask.TASK_COUNT); - assertEquals(task.aggregatedStats.getAttr(ProfilerTask.VFS_STAT).count, 2); + assertEquals(2, task.aggregatedStats.getAttr(ProfilerTask.VFS_STAT).count); task = info.allTasksById.get(2); assertThat(task.durationNanos).isEqualTo(0); task = info.allTasksById.get(3); - assertEquals(task.stats.getAttr(ProfilerTask.VFS_STAT).count, 2); - assertEquals(task.subtasks.length, 1); - assertEquals(task.subtasks[0].getDescription(), "stat2"); + assertEquals(2, task.stats.getAttr(ProfilerTask.VFS_STAT).count); + assertEquals(1, task.subtasks.length); + assertEquals("stat2", task.subtasks[0].getDescription()); // assert that startTime grows with id long time = -1; for (ProfileInfo.Task t : info.allTasksById) { @@ -266,17 +264,17 @@ public class ProfilerTest extends FoundationTestCase { ProfileInfo info = ProfileInfo.loadProfile(cacheFile); info.calculateStats(); info.analyzeRelationships(); - assertEquals(info.allTasksById.size(), 4 + 10000 + 10000); // total number of tasks - assertEquals(info.tasksByThread.size(), 3); // total number of threads + assertEquals(4 + 10000 + 10000, info.allTasksById.size()); // total number of tasks + assertEquals(3, info.tasksByThread.size()); // total number of threads // while main thread had 3 tasks, 2 of them were nested, so tasksByThread // would contain only one "main task" task - assertEquals(info.tasksByThread.get(id).length, 2); + assertEquals(2, info.tasksByThread.get(id).length); ProfileInfo.Task mainTask = info.tasksByThread.get(id)[0]; - assertEquals(mainTask.getDescription(), "main task"); - assertEquals(mainTask.subtasks.length, 2); + assertEquals("main task", mainTask.getDescription()); + assertEquals(2, mainTask.subtasks.length); // other threads had 10000 independent recorded tasks each - assertEquals(info.tasksByThread.get(id1).length, 10000); - assertEquals(info.tasksByThread.get(id2).length, 10000); + assertEquals(10000, info.tasksByThread.get(id1).length); + assertEquals(10000, info.tasksByThread.get(id2).length); int startId = mainTask.subtasks[0].id; // id of "starting threads" int endId = mainTask.subtasks[1].id; // id of "joining" assertTrue(startId < info.tasksByThread.get(id1)[0].id); |