@@ -354,16 +354,15 @@ static CLEAR_OFFSET_OUTSIDE_RESOURCE_BOUNDS: GpuTestConfiguration = GpuTestConfi
354354
355355 let out_of_bounds = size. checked_add ( wgpu:: COPY_BUFFER_ALIGNMENT ) . unwrap ( ) ;
356356
357- ctx. device . push_error_scope ( wgpu:: ErrorFilter :: Validation ) ;
358- ctx. device
359- . create_command_encoder ( & Default :: default ( ) )
360- . clear_buffer ( & buffer, out_of_bounds, None ) ;
361- let err_msg = pollster:: block_on ( ctx. device . pop_error_scope ( ) )
362- . unwrap ( )
363- . to_string ( ) ;
364- assert ! ( err_msg. contains(
365- "Clear of 20..20 would end up overrunning the bounds of the buffer of size 16"
366- ) ) ;
357+ wgpu_test:: fail (
358+ & ctx. device ,
359+ || {
360+ ctx. device
361+ . create_command_encoder ( & Default :: default ( ) )
362+ . clear_buffer ( & buffer, out_of_bounds, None )
363+ } ,
364+ Some ( "Clear of 20..20 would end up overrunning the bounds of the buffer of size 16" ) ,
365+ ) ;
367366 } ) ;
368367
369368#[ gpu_test]
@@ -381,19 +380,20 @@ static CLEAR_OFFSET_PLUS_SIZE_OUTSIDE_U64_BOUNDS: GpuTestConfiguration =
381380 let max_valid_offset = u64:: MAX - ( u64:: MAX % wgpu:: COPY_BUFFER_ALIGNMENT ) ;
382381 let smallest_aligned_invalid_size = wgpu:: COPY_BUFFER_ALIGNMENT ;
383382
384- ctx. device . push_error_scope ( wgpu:: ErrorFilter :: Validation ) ;
385- ctx. device
386- . create_command_encoder ( & Default :: default ( ) )
387- . clear_buffer (
388- & buffer,
389- max_valid_offset,
390- Some ( smallest_aligned_invalid_size) ,
391- ) ;
392- let err_msg = pollster:: block_on ( ctx. device . pop_error_scope ( ) )
393- . unwrap ( )
394- . to_string ( ) ;
395- assert ! ( err_msg. contains( concat!(
396- "Clear starts at offset 18446744073709551612 with size of 4, " ,
397- "but these added together exceed `u64::MAX`"
398- ) ) ) ;
383+ wgpu_test:: fail (
384+ & ctx. device ,
385+ || {
386+ ctx. device
387+ . create_command_encoder ( & Default :: default ( ) )
388+ . clear_buffer (
389+ & buffer,
390+ max_valid_offset,
391+ Some ( smallest_aligned_invalid_size) ,
392+ )
393+ } ,
394+ Some ( concat ! (
395+ "Clear starts at offset 18446744073709551612 with size of 4, " ,
396+ "but these added together exceed `u64::MAX`"
397+ ) ) ,
398+ ) ;
399399 } ) ;
0 commit comments