From 499cac488fa4d00025e0d9926b5f0830940dec1d Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 2 Sep 2022 17:04:31 +0200 Subject: [PATCH] use `TempFixture` for rasterband get_statistics test --- src/raster/tests.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/raster/tests.rs b/src/raster/tests.rs index 3f6a1c72..9f99c17f 100644 --- a/src/raster/tests.rs +++ b/src/raster/tests.rs @@ -4,6 +4,7 @@ use crate::raster::rasterband::ResampleAlg; use crate::raster::{ ByteBuffer, ColorInterpretation, RasterCreationOption, StatisticsAll, StatisticsMinMax, }; +use crate::test_utils::TempFixture; use crate::vsi::unlink_mem_file; use crate::Driver; use gdal_sys::GDALDataType; @@ -806,7 +807,9 @@ fn test_color_table() { #[test] fn test_raster_stats() { - let dataset = Dataset::open(fixture!("tinymarble.tif")).unwrap(); + let fixture = TempFixture::fixture("tinymarble.tif"); + + let dataset = Dataset::open(&fixture).unwrap(); let rb = dataset.rasterband(1).unwrap(); assert!(rb.get_statistics(false, false).unwrap().is_none()); @@ -828,8 +831,4 @@ fn test_raster_stats() { max: 255.0, } ); - - // clean up aux file - drop(dataset); - std::fs::remove_file(fixture!("tinymarble.tif.aux.xml")).unwrap(); }