예제 #1
0
        SBMLError getErrorWithSeverity(long n, long severity)
        {
            IntPtr    cPtr = libsbmlPINVOKE.SBMLErrorLog_getErrorWithSeverity(swigCPtr, n, severity);
            SBMLError ret  = (cPtr == IntPtr.Zero) ? null : new SBMLError(cPtr, false);

            return(ret);
        }
예제 #2
0
        SBMLError getError(long n)
        {
            IntPtr    cPtr = libsbmlPINVOKE.SBMLErrorLog_getError(swigCPtr, n);
            SBMLError ret  = (cPtr == IntPtr.Zero) ? null : new SBMLError(cPtr, false);

            return(ret);
        }
예제 #3
0
        SBMLError getFailure(long n)
        {
            global::System.IntPtr cPtr = libsbmlPINVOKE.SBMLValidator_getFailure(swigCPtr, n);
            SBMLError             ret  = (cPtr == global::System.IntPtr.Zero) ? null : new SBMLError(cPtr, false);

            return(ret);
        }
예제 #4
0
 void add(SBMLError error)
 {
     libsbmlPINVOKE.SBMLErrorLog_add(swigCPtr, SBMLError.getCPtr(error));
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
예제 #5
0
 void logFailure(SBMLError err)
 {
     libsbmlPINVOKE.SBMLValidator_logFailure(swigCPtr, SBMLError.getCPtr(err));
     if (libsbmlPINVOKE.SWIGPendingException.Pending)
     {
         throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public void test_SBMLError_create()
        {
            SBMLError error = new SBMLError();

            assertTrue(error != null);
            error = null;
            error = new SBMLError(libsbml.EmptyListInReaction);
            assertTrue(error.getErrorId() == libsbml.EmptyListInReaction);
            //assertTrue( error.getSeverity() == libsbml.LIBSBML_SEV_ERROR );
            //assertTrue( error.getSeverityAsString() ==  "Error"  );
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_SBML);
            assertTrue(error.getCategoryAsString() == "General SBML conformance");
            error = null;
            error = new SBMLError(libsbml.OverdeterminedSystem, 2, 1);
            assertTrue(error.getErrorId() == libsbml.OverdeterminedSystem);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_WARNING);
            assertTrue(error.getSeverityAsString() == "Warning");
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_OVERDETERMINED_MODEL);
            assertTrue(error.getCategoryAsString() == "Overdetermined model");
            error = null;
            error = new SBMLError(libsbml.OffsetNoLongerValid, 2, 2);
            assertTrue(error.getErrorId() == libsbml.OffsetNoLongerValid);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_ERROR);
            assertTrue(error.getSeverityAsString() == "Error");
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_GENERAL_CONSISTENCY);
            assertTrue(error.getCategoryAsString() == "SBML component consistency");
            error = null;
            error = new SBMLError(libsbml.NoSBOTermsInL1, 2, 2);
            assertTrue(error.getErrorId() == libsbml.NoSBOTermsInL1);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_WARNING);
            assertTrue(error.getSeverityAsString() == "Warning");
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_SBML_L1_COMPAT);
            assertTrue(error.getCategoryAsString() == "Translation to SBML L1V2");
            error = null;
            error = new SBMLError(libsbml.DisallowedMathMLEncodingUse, 2, 2);
            assertTrue(error.getErrorId() == libsbml.DisallowedMathMLEncodingUse);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_ERROR);
            assertTrue(error.getSeverityAsString() == "Error");
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_MATHML_CONSISTENCY);
            assertTrue(error.getShortMessage() == "Use of the MathML 'encoding' attribute is not allowed on this element");
            error = null;
            error = new SBMLError(libsbml.DisallowedMathMLEncodingUse, 1, 2);
            assertTrue(error.getErrorId() == libsbml.DisallowedMathMLEncodingUse);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_NOT_APPLICABLE);
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_MATHML_CONSISTENCY);
            error = null;
            error = new SBMLError(libsbml.UnknownError, 2, 4);
            assertTrue(error.getErrorId() == libsbml.UnknownError);
            assertTrue(error.getSeverity() == libsbml.LIBSBML_SEV_FATAL);
            assertTrue(error.getSeverityAsString() == "Fatal");
            assertTrue(error.getCategory() == libsbml.LIBSBML_CAT_INTERNAL);
            assertTrue(error.getShortMessage() == "Encountered unknown internal libSBML error");
            error = null;
        }
 SBMLError getFailure(long n) {
    IntPtr cPtr = libsbmlPINVOKE.SBMLValidator_getFailure(swigCPtr, n);
    SBMLError ret = (cPtr == IntPtr.Zero) ? null : new SBMLError(cPtr, false);
    return ret;
  }