Skip to content

Commit

Permalink
GeoPackage test no longer errors
Browse files Browse the repository at this point in the history
This is all that is required to fix tests after JuliaGeo/GDAL.jl#153
  • Loading branch information
visr committed Jun 2, 2023
1 parent 4ddd99b commit 24ef87a
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions test/test_dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,37 +107,28 @@ end
for dsname in ("point", "metropole")
AG.read("data/$dsname.geojson") do input_ds
try
# the GPKG driver can handle field ids of type real, which is the case for point.geojson
if driver == "GPKG" && dsname == "point"
@test_throws GDAL.GDALError AG.write(
input_ds,
fname;
driver = AG.getdriver(driver),
)
else
AG.write(
input_ds,
fname;
driver = AG.getdriver(driver),
use_gdal_copy = true,
)
@test assertsimilar(input_ds, AG.read(fname))
# sleep and GC are for windows: let the gc run to close the file, otherwise it can't be deleted
sleep(0.05)
GC.gc()
rm(fname, force = true, recursive = true)
AG.write(
input_ds,
fname;
driver = AG.getdriver(driver),
use_gdal_copy = true,
)
@test assertsimilar(input_ds, AG.read(fname))
# sleep and GC are for windows: let the gc run to close the file, otherwise it can't be deleted
sleep(0.05)
GC.gc()
rm(fname, force = true, recursive = true)

AG.write(
input_ds,
fname;
driver = AG.getdriver(driver),
use_gdal_copy = false,
)
@test assertsimilar(input_ds, AG.read(fname))
sleep(0.05)
GC.gc()
rm(fname, force = true, recursive = true)
end
AG.write(
input_ds,
fname;
driver = AG.getdriver(driver),
use_gdal_copy = false,
)
@test assertsimilar(input_ds, AG.read(fname))
sleep(0.05)
GC.gc()
rm(fname, force = true, recursive = true)
finally
sleep(0.05)
GC.gc()
Expand Down

0 comments on commit 24ef87a

Please sign in to comment.