-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed <leakCanary debug="true" /> to <leakCanary /> and LeakConfig.debug is deprecated
- Loading branch information
hui.zhao
authored and
hui.zhao
committed
Mar 25, 2020
1 parent
e9ad0d9
commit b00eaeb
Showing
9 changed files
with
72 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...d-godeye/src/test/java/cn/hikyson/godeye/core/internal/modules/memory/MemoryUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cn.hikyson.godeye.core.internal.modules.memory; | ||
|
||
import android.os.Build; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.RobolectricTestRunner; | ||
import org.robolectric.annotation.Config; | ||
|
||
import cn.hikyson.godeye.core.GodEye; | ||
import cn.hikyson.godeye.core.helper.RoboTestApplication; | ||
|
||
@RunWith(RobolectricTestRunner.class) | ||
@Config(sdk = Build.VERSION_CODES.LOLLIPOP, application = RoboTestApplication.class) | ||
public class MemoryUtilTest { | ||
|
||
@Test | ||
public void getAppHeapInfo() { | ||
HeapInfo heapInfo = MemoryUtil.getAppHeapInfo(); | ||
Assert.assertTrue(heapInfo.allocatedKb > 0); | ||
Assert.assertTrue(heapInfo.freeMemKb > 0); | ||
Assert.assertTrue(heapInfo.maxMemKb > 0); | ||
} | ||
|
||
@Test | ||
public void getAppPssInfo() { | ||
try { | ||
PssInfo pssInfo = MemoryUtil.getAppPssInfo(GodEye.instance().getApplication()); | ||
} catch (NullPointerException ignore) { | ||
} catch (Throwable e) { | ||
Assert.fail(); | ||
} | ||
} | ||
|
||
@Test | ||
public void getRamInfo() { | ||
RamInfo ramInfo = MemoryUtil.getRamInfo(GodEye.instance().getApplication()); | ||
Assert.assertNotNull(ramInfo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters