mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-10-14 15:05:36 +02:00
Add VALIJSON_USE_EXCEPTIONS mode
This patch adds support for a new Cmake option, VALIJSON_USE_EXCEPTIONS. If specified and set to `0`, Valijson will disable all exception throwing, add the `-fno-exceptions` compiler flag, and print to std::err and abort where exceptions would have been thrown. NOTE: to set the value of a CMake option, the easiest way is to modify the appropriate source line in the <build folder>/CMakeCache.txt file. Bug: #106
This commit is contained in:
@@ -36,7 +36,11 @@ TEST_F(TestValidationErrors, AllOfConstraintFailure)
|
||||
// Parse schema document
|
||||
Schema schema;
|
||||
SchemaParser schemaParser;
|
||||
ASSERT_NO_THROW( schemaParser.populateSchema(schemaAdapter, schema) );
|
||||
#if VALIJSON_USE_EXCEPTIONS
|
||||
ASSERT_NO_THROW(schemaParser.populateSchema(schemaAdapter, schema));
|
||||
#else
|
||||
schemaParser.populateSchema(schemaAdapter, schema);
|
||||
#endif
|
||||
|
||||
// Load test document
|
||||
rapidjson::Document testDocument;
|
||||
|
Reference in New Issue
Block a user