27604018f783bf6354a13870b3e7785edca69b5f |
|
28-Sep-2016 |
Paul Duffin <paulduffin@google.com> |
Detect and fix resource leakages in tests Tests that test those classes that use CloseGuard to detect reosurce leakages are switched to use TestCaseWithRules and ResourceLeakageDetector.getRule() to detect any resource leakages and the leaks fixed. A number of tests could not be fixed due to bugs in the core classes so a new DisableResourceLeakageDetection annotation was added as part of this change. A method annotated with that does not perform resource leakage detection. The affected tests were annotated with a description and a reference to an associated bug. This uses try-with-resources to aid in closing resources. While that does provide some benefits it is all too easy to change the behavior of the test unless care is taken. To avoid that it is important not to merge it with an existing try block such as those which follow the following pattern: try {... fail()} catch(..) {} Merging them could result in the test catching and ignoring exceptions thrown during the creation of the resource which is almost certainly not what the test was intending. Test: Tested with vogar and CTS Bug: 31542223 Change-Id: Id32bb40fe04eb9719d7e6cd367abb53118b21832
|
108a6c5cbecfea0bb2ea15e522b4e5474c4f81bd |
|
19-Dec-2013 |
Narayan Kamath <narayan@google.com> |
Fix broken test cases in DeflaterTest & InflaterTest We explicitly disallow setLevel or setStrategy after setInput. (It's clearly documented in the method docs). Presumably, this is to prevent users from shooting themselves in the foot & causing issues by changing the strategy / level after we've started deflating. Change-Id: Ifd65728ff0ec7e47aeec716aeb6f44242573c491
|
d567f9025c4b94fc5e9b47f5702c1b48c2a45c96 |
|
17-Dec-2013 |
Narayan Kamath <narayan@google.com> |
Move tests from harmony/archive to libcore. Also moves a couple of tests from luni/src/test to harmony-tests/ where they belong. Change-Id: I0b441b1fcbd355bd3c66551d16732a671fb64f54
|