File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,13 @@ async fn test_garbage_collection() -> JvmResult<()> {
2323 assert_eq ! ( garbage_count, 3 ) ;
2424
2525 // load a class
26+ jvm. push_native_frame ( ) ;
2627 let _ = jvm. resolve_class ( "java/util/Random" ) . await ?;
28+ jvm. pop_frame ( ) ;
29+
2730 let garbage_count = jvm. collect_garbage ( ) ?;
2831
29- assert_eq ! ( garbage_count, 0 ) ;
32+ assert_eq ! ( garbage_count, 3 ) ;
3033
3134 // use loaded class
3235 jvm. push_native_frame ( ) ;
@@ -37,11 +40,14 @@ async fn test_garbage_collection() -> JvmResult<()> {
3740 assert_eq ! ( garbage_count, 1 ) ;
3841
3942 // load another class
43+ jvm. push_native_frame ( ) ;
4044 let _ = jvm. resolve_class ( "java/util/Vector" ) . await ?;
45+ jvm. pop_frame ( ) ;
46+
4147 let garbage_count = jvm. collect_garbage ( ) ?;
4248
4349 // temporaries used in class loading should be garbage collected
44- assert_eq ! ( garbage_count, 6 ) ;
50+ assert_eq ! ( garbage_count, 9 ) ;
4551
4652 // use loaded class
4753 jvm. push_native_frame ( ) ;
You can’t perform that action at this time.
0 commit comments