Skip to content

Commit c815c27

Browse files
committed
Adjust gc tes
1 parent 72706f1 commit c815c27

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

jvm/tests/test_garbage_collection.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)