diff --git a/tests/tests/mem_leaks.rs b/tests/tests/mem_leaks.rs index 2e364a850f..05a7026a40 100644 --- a/tests/tests/mem_leaks.rs +++ b/tests/tests/mem_leaks.rs @@ -214,6 +214,7 @@ fn draw_test_with_reports( drop(ppl); drop(bgl); drop(bg); + drop(buffer); let global_report = ctx.instance.generate_report(); let report = global_report.hub_report(); @@ -229,6 +230,8 @@ fn draw_test_with_reports( assert_eq!(report.bind_groups.num_kept_from_user, 0); assert_eq!(report.texture_views.num_allocated, 1); assert_eq!(report.texture_views.num_kept_from_user, 0); + assert_eq!(report.buffers.num_allocated, 1); + assert_eq!(report.buffers.num_kept_from_user, 0); assert_eq!(report.textures.num_allocated, 1); assert_eq!(report.textures.num_kept_from_user, 0); @@ -248,17 +251,24 @@ fn draw_test_with_reports( assert_eq!(report.bind_group_layouts.num_allocated, 0); assert_eq!(report.pipeline_layouts.num_allocated, 0); assert_eq!(report.texture_views.num_allocated, 0); - assert_eq!(report.textures.num_allocated, 1); - assert_eq!(report.buffers.num_allocated, 1); + assert_eq!(report.buffers.num_allocated, 0); drop(ctx.queue); drop(ctx.device); + drop(ctx.adapter); let global_report = ctx.instance.generate_report(); let report = global_report.hub_report(); - assert_eq!(report.devices.num_kept_from_user, 0); assert_eq!(report.queues.num_kept_from_user, 0); + assert_eq!(report.queues.num_allocated, 0); + //Still one texture alive because surface is not dropped till the end + assert_eq!(report.textures.num_allocated, 1); + //that is keeping still the device alive + assert_eq!(report.devices.num_allocated, 1); + assert_eq!(report.textures.num_kept_from_user, 0); + assert_eq!(report.devices.num_kept_from_user, 0); + } #[test]