Exemplo n.º 1
0
END_TEST


START_TEST (test_L3_KineticLaw_addParameter2)
{
  KineticLaw_t *kl = KineticLaw_create(3, 1);
  LocalParameter_t *lp 
    = LocalParameter_create(3, 1);
  LocalParameter_t *lp1 
    = LocalParameter_create(3, 1);

  int i = KineticLaw_addLocalParameter(kl, lp);

  fail_unless( i == LIBSBML_INVALID_OBJECT);
    
  LocalParameter_setId(lp, "p");
  LocalParameter_setId(lp1, "p1");
  i = KineticLaw_addLocalParameter(kl, lp);

  fail_unless( i == LIBSBML_OPERATION_SUCCESS);
  fail_unless( KineticLaw_getNumParameters(kl) == 1);
  fail_unless( KineticLaw_getNumLocalParameters(kl) == 1);

  i = KineticLaw_addParameter(kl, (Parameter_t *)lp1);
  fail_unless( i == LIBSBML_OPERATION_SUCCESS);
  fail_unless( KineticLaw_getNumParameters(kl) == 2);
  fail_unless( KineticLaw_getNumLocalParameters(kl) == 2);

  LocalParameter_free(lp);
  LocalParameter_free(lp1);
  KineticLaw_free(kl);
}
Exemplo n.º 2
0
END_TEST


START_TEST (test_L3_LocalParameter_hasRequiredAttributes )
{
  LocalParameter_t *p = LocalParameter_create (3, 1);

  fail_unless ( !LocalParameter_hasRequiredAttributes(p));

  LocalParameter_setId(p, "id");

  fail_unless ( LocalParameter_hasRequiredAttributes(p));

  LocalParameter_free(p);
}
Exemplo n.º 3
0
END_TEST


START_TEST (test_L3_LocalParameter_id)
{
  const char *id = "mitochondria";


  fail_unless( !LocalParameter_isSetId(P) );
  
  LocalParameter_setId(P, id);

  fail_unless( !strcmp(LocalParameter_getId(P), id) );
  fail_unless( LocalParameter_isSetId(P) );

  if (LocalParameter_getId(P) == id)
  {
    fail("LocalParameter_setId(...) did not make a copy of string.");
  }
}