示例#1
0
END_TEST


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


  fail_unless( !Event_isSetId(E) );
  
  Event_setId(E, id);

  fail_unless( !strcmp(Event_getId(E), id) );
  fail_unless( Event_isSetId(E) );

  if (Event_getId(E) == id)
  {
    fail("Event_setId(...) did not make a copy of string.");
  }
 
  Event_unsetId(E);
  
  fail_unless( !Event_isSetId(E) );

  if (Event_getId(E) != NULL)
  {
    fail("Event_unsetId(E) did not clear string.");
  }
}
END_TEST


START_TEST (test_Event_setId2)
{
  const char *id = "e1";
  int i = Event_setId(E, id);

  fail_unless( i == LIBSBML_OPERATION_SUCCESS );
  fail_unless( !strcmp(Event_getId(E), id) );
  fail_unless( Event_isSetId(E) );

  i = Event_unsetId(E);

  fail_unless( i == LIBSBML_OPERATION_SUCCESS );
  fail_unless( !Event_isSetId(E) );
}