コード例 #1
0
END_TEST


START_TEST (test_Trigger_createWithNS )
{
    XMLNamespaces_t *xmlns = XMLNamespaces_create();
    XMLNamespaces_add(xmlns, "http://www.sbml.org", "testsbml");
    SBMLNamespaces_t *sbmlns = SBMLNamespaces_create(2,1);
    SBMLNamespaces_addNamespaces(sbmlns,xmlns);

    Trigger_t *object =
        Trigger_createWithNS (sbmlns);


    fail_unless( SBase_getTypeCode  ((SBase_t *) object) == SBML_TRIGGER );
    fail_unless( SBase_getMetaId    ((SBase_t *) object) == NULL );
    fail_unless( SBase_getNotes     ((SBase_t *) object) == NULL );
    fail_unless( SBase_getAnnotation((SBase_t *) object) == NULL );

    fail_unless( SBase_getLevel       ((SBase_t *) object) == 2 );
    fail_unless( SBase_getVersion     ((SBase_t *) object) == 1 );

    fail_unless( Trigger_getNamespaces     (object) != NULL );
    fail_unless( XMLNamespaces_getLength(Trigger_getNamespaces(object)) == 2 );

    Trigger_free(object);
}
コード例 #2
0
END_TEST


START_TEST (test_L3Trigger_setPersistent1)
{
  Trigger_t *t = Trigger_create(2, 4);

  int i = Trigger_setPersistent(t, 0);

  fail_unless( i == LIBSBML_UNEXPECTED_ATTRIBUTE );
 
  fail_unless( Trigger_getPersistent(T) == 1 );
  fail_unless( Trigger_isSetPersistent(T) == 0 );

  Trigger_free(t);
}
コード例 #3
0
END_TEST


START_TEST (test_L3_Event_hasRequiredElements )
{
  Event_t *e = Event_create (3, 1);

  fail_unless ( !Event_hasRequiredElements(e));

  Trigger_t *t = Trigger_create(3, 1);
  ASTNode_t* math = SBML_parseFormula("true");
  Trigger_setMath(t, math);
  ASTNode_free(math);
  Trigger_setInitialValue(t, 1);
  Trigger_setPersistent(t, 1);
  Event_setTrigger(e, t);

  fail_unless ( Event_hasRequiredElements(e));

  Event_free(e);
  Trigger_free(t);
}
コード例 #4
0
END_TEST


START_TEST (test_L3Trigger_setInitialValue1)
{
    Trigger_t *t = Trigger_create(2, 4);

    int i = Trigger_setInitialValue(t, 0);

    fail_unless( i == LIBSBML_UNEXPECTED_ATTRIBUTE );

    fail_unless( Trigger_getInitialValue(T) == 1 );
    fail_unless( Trigger_isSetInitialValue(T) == 0 );

    i = Trigger_unsetInitialValue(t);

    fail_unless( i == LIBSBML_UNEXPECTED_ATTRIBUTE );

    fail_unless( Trigger_getInitialValue(T) == 1 );
    fail_unless( Trigger_isSetInitialValue(T) == 0 );

    Trigger_free(t);
}
コード例 #5
0
END_TEST


//START_TEST (test_Trigger_createWithMath)
//{
//  ASTNode_t            *math = SBML_parseFormula("x^3");
//  Trigger_t *fd   = Trigger_createWithMath(math);
//
//  const ASTNode_t * math1;
//  char * formula;
//
//  fail_unless( SBase_getTypeCode((SBase_t *) fd) == SBML_TRIGGER );
//  fail_unless( SBase_getMetaId    ((SBase_t *) fd) == NULL );
//  fail_unless( SBase_getNotes     ((SBase_t *) fd) == NULL );
//  fail_unless( SBase_getAnnotation((SBase_t *) fd) == NULL );
//
//
//  math1 = Trigger_getMath(fd);
//  fail_unless( math1 != NULL );
//
//  formula = SBML_formulaToString(math1);
//  fail_unless( formula != NULL );
//  fail_unless( !strcmp(formula, "x^3") );
//  fail_unless( Trigger_getMath(fd) != math );
//  fail_unless( Trigger_isSetMath(fd) );
//
//
//  Trigger_free(fd);
//}
//END_TEST


START_TEST (test_Trigger_free_NULL)
{
    Trigger_free(NULL);
}
コード例 #6
0
void
L3TriggerTest_teardown (void)
{
  Trigger_free(T);
}
コード例 #7
0
void
TriggerTest_teardown (void)
{
    Trigger_free(D);
}