summaryrefslogtreecommitdiff
path: root/include/ScopedJavaUnicodeString.h
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2016-08-12 11:32:44 +0100
committerPaul Duffin <paulduffin@google.com>2016-10-03 15:27:09 +0100
commitfe0ee8ef8870338ad67ebfb6b62785e0cbdb325b (patch)
tree093dfab5464971a259b2140381cc67c16402411d /include/ScopedJavaUnicodeString.h
parent24e3caf3a383921f8c45122fd38ca839c581608a (diff)
Improve resource leakage detection testing
This change makes various improvements to the support for testing resource leakage detection. Adds CloseGuard.Tracker to allow tests to track the lifecycle of CloseGuard allocation sites directly. Adds CloseGuardSupport to use CloseGuard.Tracker to provide: * A BiConsumer that can be used to help check that objects which own resources protected by CloseGuard correctly detect resource leakage. * A TestRule that allows tests to check that system code does not leak resources, especially under error conditions. Adds a new ResourceLeakageDetector that uses reflection to access CloseGuardSupport. This can safely be used in code that needs to compile and run on OpenJDK. Adds TestCaseWithRules to allow the TestRule above to be used with JUnit 3 style tests without converting the whole test to JUnit 4 style. Changed libcore.java.lang.ProcessBuilderTest to use TestCase as ProcessBuilder does not have any CloseGuard protected resources. That allows AbstractResourceLeakageDetectorTestCase to be deleted. Changed RandomAccessFileTest to use TestCaseWithRules and ResourceLeakageDetector. Fixed issues that it highlighted, fixed testRandomAccessFileHasCleanupFinalizer test and removed it from expectations/knownfailures.txt. Adds core-test-rules/-hostdex targets to encapsulate TestRule and related classes that can be shared with other projects. Removes the following now unused classes: * CloseGuardMonitor * AbstractResourceLeakageDetectorTest * The old ResourceLeakageDetector and associated test. Bug: 31542223 Test: Ran tests on both Vogar and CTS Change-Id: I8f802b52fdbeac0a30f339a9ceca5d2eaaafd180
Diffstat (limited to 'include/ScopedJavaUnicodeString.h')
0 files changed, 0 insertions, 0 deletions