Created
April 22, 2017 21:46
-
-
Save schwehr/d4d48b60ed99986ce18703262fe98758 to your computer and use it in GitHub Desktop.
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
class WithQuietHandler { | |
public: | |
WithQuietHandler() { CPLPushErrorHandler(CPLQuietErrorHandler); } | |
~WithQuietHandler() { CPLPopErrorHandler(); } | |
}; | |
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |
WithQuietHandler handler; | |
const char kFilename[] = "/vsimem/a.geojson"; | |
const string data2(reinterpret_cast<const char *>(data), size); | |
autotest2::VsiMemTempWrapper wrapper(kFilename, data2); | |
auto open_info = | |
gtl::MakeUnique<GDALOpenInfo>(kFilename, GDAL_OF_READONLY, nullptr); | |
std::unique_ptr<OGRGeoJSONDataSource> dataset(new OGRGeoJSONDataSource); | |
const int result = dataset->Open(open_info.get(), eGeoJSONSourceFile); | |
CHECK(result == FALSE || result == TRUE); | |
// TODO(schwehr): Try to go through the rows. | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment