-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix of custom GDAL error handler management by deregistrating it at e…
…xit (done in `__init__()`). Plus a few modifications on GDAL utilities' tests and (#245) * For GDAL utilities tests, separate error tests from normal tests * Added GDAL import in test_images.jl * Suppressed `@time` macro in test_ospy_examples.jl * Add `@test_logs` to two tests issuing a warning in test_rasterattrtable.jl * CPLDestroyMutex Error narrowed on one test in test_gdalutilities_errors.jl * `GDAL.gdalinfo` in a try...finally block * fixed a typo in file name in "GDAL error" testset * changed `options` local variable name in `AG.gdalinfo` in case it may interfere with `options` arg * Tried to test errored `AG.galinfo` with `@test` instead of `@test_throws` * cleanup after (unsuccessful) investigation on "CPLDestroyMutex: Error = 16" issue * DriverManager modifications proposition * deregister gdaljl_errorhandler at exit * deregisterering gdaljl_errorhandler via an anonymous function to avoid test coverage decrease * Cleanup keeping gdaljl_errorhandler deregistration at exit in __init()__ * Suppressed `GDAL.cplseterrorhandler` (handled in GDAL.jl `__init__()`) and added `GDAL.gdaldestroydrivermanager` in `atexit` * Cleanup in `__init__()` with GDAL.jl PR #124 as prerequisite * Suppressed comments in ArchGDAL.jl `__init__()` function * Dropped `gdalallregister()` in `__init__()` since it has been added to GDAL.jl in PR JuliaGeo/GDAL.jl#124
- Loading branch information
1 parent
58e2073
commit 43e1408
Showing
8 changed files
with
126 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import ArchGDAL, GDAL; | ||
const AG = ArchGDAL | ||
using Test | ||
|
||
@testset "test_gdalutilities_errors.jl" begin | ||
AG.read("data/utmsmall.tif") do ds_small | ||
@testset "GDAL Error" begin | ||
@test_throws GDAL.GDALError AG.gdalinfo( | ||
ds_small, | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdaltranslate( | ||
ds_small, | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalbuildvrt( | ||
[ds_small], | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdaldem( | ||
ds_small, | ||
"hillshade", | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalnearblack( | ||
ds_small, | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalwarp( | ||
[ds_small], | ||
["-novalidoption"], | ||
) | ||
end | ||
end | ||
|
||
@testset "Interactive data/utmsmall.tif" begin | ||
ds_small = AG.read("data/utmsmall.tif") | ||
@test_throws GDAL.GDALError AG.gdalinfo(ds_small, ["-novalidoption"]) | ||
@test_throws GDAL.GDALError AG.unsafe_gdaltranslate( | ||
ds_small, | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalbuildvrt( | ||
[ds_small], | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdaldem( | ||
ds_small, | ||
"hillshade", | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalnearblack( | ||
ds_small, | ||
["-novalidoption"], | ||
) | ||
@test_throws GDAL.GDALError AG.unsafe_gdalwarp( | ||
[ds_small], | ||
["-novalidoption"], | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters