summaryrefslogtreecommitdiff
path: root/subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java')
-rw-r--r--subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java b/subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java
deleted file mode 100644
index 439c888..0000000
--- a/subprojects/inline/src/test/java/org/mockitoinline/bugs/CyclicMockMethodArgumentMemoryLeakTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2019 Mockito contributors
- * This program is made available under the terms of the MIT License.
- */
-
-package org.mockitoinline.bugs;
-
-import org.junit.Test;
-
-import static org.mockito.Mockito.framework;
-import static org.mockito.Mockito.mock;
-
-public class CyclicMockMethodArgumentMemoryLeakTest {
- private static final int ARRAY_LENGTH = 1 << 20; // 4 MB
-
- @Test
- public void no_memory_leak_when_cyclically_calling_method_with_mocks() {
- for (int i = 0; i < 100; ++i) {
- final A a = mock(A.class);
- a.largeArray = new int[ARRAY_LENGTH];
- final B b = mock(B.class);
-
- a.accept(b);
- b.accept(a);
-
- framework().clearInlineMocks();
- }
- }
-
- private static class A {
- private int[] largeArray;
-
- void accept(B b) {}
- }
-
- private static class B {
- void accept(A a) {}
- }
-}