unsigned int MultiSBMLDocumentPlugin::checkConsistency() { unsigned int nerrors = 0; unsigned int total_errors = 0; SBMLDocument* doc = static_cast<SBMLDocument *>(this->getParentSBMLObject()); SBMLErrorLog *log = doc->getErrorLog(); unsigned char applicableValidators = doc->getApplicableValidators(); /* determine which validators to run */ bool id = ((applicableValidators & 0x01) == 0x01); bool sbml = ((applicableValidators & 0x02) == 0x02); /* LIST OTHERS HERE */ MultiIdentifierConsistencyValidator id_validator; MultiConsistencyValidator validator; /* LIST OTHERS HERE */ if (id) { id_validator.init(); nerrors = id_validator.validate(*doc); total_errors += nerrors; if (nerrors > 0) { log->add(id_validator.getFailures() ); /* only want to bail if errors not warnings */ if (log->getNumFailsWithSeverity(LIBSBML_SEV_ERROR) > 0) { return total_errors; } } } if (sbml) { validator.init(); nerrors = validator.validate(*doc); total_errors += nerrors; if (nerrors > 0) { log->add(validator.getFailures() ); // DO NOT NEED THIS IN LAST CALL // /* only want to bail if errors not warnings */ // if (log->getNumFailsWithSeverity(LIBSBML_SEV_ERROR) > 0) // { // return total_errors; // } } } /* ADD OTHERS HERE */ return total_errors; }
LIBSBML_CPP_NAMESPACE_USE /** @endcond */ /* * @return true if the Validator behaved as expected when validating * TestFile, false otherwise. */ bool runMainTest (const TestFile& file) { MultiConsistencyValidator validator; TestValidator tester(validator); validator.init(); return tester.test(file); return true; }