Skip to content

Commit

Permalink
Added GDAL test. Currently segfaulting in pio_swapm()
Browse files Browse the repository at this point in the history
MSL
  • Loading branch information
msl3v committed Jan 9, 2024
1 parent e4f67af commit 87986f8
Show file tree
Hide file tree
Showing 13 changed files with 1,106 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/clib/pio_gdal.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ GDALc_shp_get_double_field(int fileid, int varid, const size_t *startp,

hF = OGR_L_GetFeature(hL,i);
ip[i] = OGR_F_GetFieldAsDouble(hF,varid);
printf("<<>> ip[%d]=%f\n",i,ip[i]);
}

return PIO_NOERR;
Expand Down
7 changes: 7 additions & 0 deletions tests/cunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ if (NOT PIO_USE_MPISERIAL)
target_link_libraries (test_simple pioc)
add_executable (test_async_perf EXCLUDE_FROM_ALL test_async_perf.c test_common.c)
target_link_libraries(test_async_perf pioc)
add_executable (test_gdal EXCLUDE_FROM_ALL test_gdal.c test_common.c)
target_link_libraries (test_gdal pioc)
endif ()
add_executable (test_spmd EXCLUDE_FROM_ALL test_spmd.c test_common.c)
target_link_libraries (test_spmd pioc)
Expand Down Expand Up @@ -154,6 +156,7 @@ add_dependencies (tests test_async_manyproc)
add_dependencies (tests test_async_1d)
add_dependencies (tests test_simple)
add_dependencies (tests test_async_perf)
add_dependencies (tests test_gdal)

# Test Timeout in seconds.
if (PIO_VALGRIND_CHECK)
Expand Down Expand Up @@ -341,5 +344,9 @@ else ()
# EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_async_perf
# NUMPROCS ${EXACTLY_FOUR_TASKS}
# TIMEOUT ${DEFAULT_TEST_TIMEOUT})
add_mpi_test(test_gdal
EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/test_gdal
NUMPROCS ${EXACTLY_FOUR_TASKS}
TIMEOUT ${DEFAULT_TEST_TIMEOUT})
endif ()
MESSAGE("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")
3 changes: 2 additions & 1 deletion tests/cunit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_darray_async test_darray_async_many test_darray_2sync \
test_async_multicomp test_async_multi2 test_async_manyproc \
test_darray_fill test_decomp_frame test_perf2 test_async_perf \
test_darray_vard test_async_1d test_darray_append test_simple \
test_darray_lossycompress
test_darray_lossycompress test_gdal

if RUN_TESTS
# Tests will run from a bash script.
Expand Down Expand Up @@ -69,6 +69,7 @@ test_async_perf_SOURCES = test_async_perf.c test_common.c pio_tests.h
test_darray_vard_SOURCES = test_darray_vard.c test_common.c pio_tests.h
test_async_1d_SOURCES = test_async_1d.c pio_tests.h
test_simple_SOURCES = test_simple.c test_common.c pio_tests.h
test_gdal_SOURCES = test_gdal.c test_common.c pio_tests.h

# Distribute the test script.
EXTRA_DIST = run_tests.sh.in CMakeLists.txt test_darray_frame.c
Expand Down
1 change: 1 addition & 0 deletions tests/cunit/data/cb_2018_us_region_20m.cpg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file added tests/cunit/data/cb_2018_us_region_20m.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/cunit/data/cb_2018_us_region_20m.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file added tests/cunit/data/cb_2018_us_region_20m.shp
Binary file not shown.
1 change: 1 addition & 0 deletions tests/cunit/data/cb_2018_us_region_20m.shp.ea.iso.gfs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<GMLFeatureClassList />
254 changes: 254 additions & 0 deletions tests/cunit/data/cb_2018_us_region_20m.shp.ea.iso.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--This file contains all the Entity and Attribute Information--><gfc:FC_FeatureCatalogue xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfc="http://www.isotc211.org/2005/gfc"
xsi:schemaLocation="https://www.ngdc.noaa.gov/metadata/published/xsd/schema/gfc/featureCataloging.xsd http://www.isotc211.org/2005/gfc">
<gmx:name>
<gco:CharacterString>Feature Catalog for the 2018 United States 1:20,000,000 Cartographic Boundary File</gco:CharacterString>
</gmx:name>
<gmx:scope>
<gco:CharacterString>The Region at a scale of 1:20,000,000</gco:CharacterString>
</gmx:scope>
<gmx:versionNumber>
<gco:CharacterString>cb_2018_region_20m</gco:CharacterString>
</gmx:versionNumber>
<gmx:versionDate>
<gco:Date>2019-05</gco:Date>
</gmx:versionDate>
<gmx:language>
<gco:CharacterString>eng</gco:CharacterString>
</gmx:language>
<gmx:characterSet>
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
codeListValue="utf8"
codeSpace="004">utf8
</gmd:MD_CharacterSetCode>
</gmx:characterSet>
<gfc:producer xlink:href="https://www.ngdc.noaa.gov/docucomp/1df27e57-4768-42de-909b-52f530601fba"
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch"/>
<gfc:featureType>
<gfc:FC_FeatureType>
<gfc:typeName>
<gco:LocalName>cb_2018_us_region_20m.shp</gco:LocalName>
</gfc:typeName>
<gfc:definition>
<gco:CharacterString>Current Region (national)</gco:CharacterString>
</gfc:definition>
<gfc:isAbstract>
<gco:Boolean>false</gco:Boolean>
</gfc:isAbstract>
<gfc:featureCatalogue uuidref="2018_region_20m.ea.iso.xml"/>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>REGIONCE</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Current Census region code</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>1</gco:CharacterString>
</gfc:label>
<gfc:definition>
<gco:CharacterString>Northeast</gco:CharacterString>
</gfc:definition>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>2</gco:CharacterString>
</gfc:label>
<gfc:definition>
<gco:CharacterString>Midwest</gco:CharacterString>
</gfc:definition>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>3</gco:CharacterString>
</gfc:label>
<gfc:definition>
<gco:CharacterString>South</gco:CharacterString>
</gfc:definition>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>4</gco:CharacterString>
</gfc:label>
<gfc:definition>
<gco:CharacterString>West</gco:CharacterString>
</gfc:definition>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>AFFGEOID</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>American FactFinder summary level code + geovariant code + '00US' + GEOID</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>American FactFinder geographic identifier</gco:CharacterString>
</gfc:label>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>GEOID</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Region code identifier, Census Region code</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label gco:nilReason="inapplicable"/>
<gfc:definition>
<gco:CharacterString>Region code code found in REGIONCE</gco:CharacterString>
</gfc:definition>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>NAME</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Current region name</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>Census geographic region names</gco:CharacterString>
</gfc:label>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>LSAD</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Current legal/statistical area description code for region</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label>
<gco:CharacterString>68</gco:CharacterString>
</gfc:label>
<gfc:definition>
<gco:CharacterString>Region (suffix)</gco:CharacterString>
</gfc:definition>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>ALAND</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Current land area (square meters)</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:valueMeasurementUnit>
<gml:DerivedUnit gml:id="areaInMetersSquaredforALAND">
<gml:identifier codeSpace="area"/>
<gml:derivationUnitTerm uom="m" exponent="2"/>
</gml:DerivedUnit>
</gfc:valueMeasurementUnit>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label gco:nilReason="inapplicable"/>
<gfc:definition>
<gco:CharacterString> Range Domain Minimum: 0
Range Domain Maximum: 9,999,999,999,999</gco:CharacterString>
</gfc:definition>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
<gfc:carrierOfCharacteristics>
<gfc:FC_FeatureAttribute>
<gfc:memberName>
<gco:LocalName>AWATER</gco:LocalName>
</gfc:memberName>
<gfc:definition>
<gco:CharacterString>Current water area (square meters)</gco:CharacterString>
</gfc:definition>
<gfc:cardinality gco:nilReason="unknown"/>
<gfc:definitionReference xlink:title="U.S. Census Bureau"
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
<gfc:valueMeasurementUnit>
<gml:DerivedUnit gml:id="areaInMetersSquaredforAWATER">
<gml:identifier codeSpace="area"/>
<gml:derivationUnitTerm uom="m" exponent="2"/>
</gml:DerivedUnit>
</gfc:valueMeasurementUnit>
<gfc:listedValue>
<gfc:FC_ListedValue>
<gfc:label gco:nilReason="inapplicable"/>
<gfc:definition>
<gco:CharacterString> Range Domain Minimum: 0
Range Domain Maximum: 9,999,999,999,999</gco:CharacterString>
</gfc:definition>
</gfc:FC_ListedValue>
</gfc:listedValue>
</gfc:FC_FeatureAttribute>
</gfc:carrierOfCharacteristics>
</gfc:FC_FeatureType>
</gfc:featureType>
</gfc:FC_FeatureCatalogue>
1 change: 1 addition & 0 deletions tests/cunit/data/cb_2018_us_region_20m.shp.iso.gfs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<GMLFeatureClassList />
Loading

0 comments on commit 87986f8

Please sign in to comment.