コード例 #1
0
END_TEST


START_TEST (test_L3_Event_name)
{
  const char *name = "My_Favorite_Factory";


  fail_unless( !Event_isSetName(E) );

  Event_setName(E, name);

  fail_unless( !strcmp(Event_getName(E), name) );
  fail_unless( Event_isSetName(E) );

  if (Event_getName(E) == name)
  {
    fail("Event_setName(...) did not make a copy of string.");
  }

  Event_unsetName(E);
  
  fail_unless( !Event_isSetName(E) );

  if (Event_getName(E) != NULL)
  {
    fail("Event_unsetName(E) did not clear string.");
  }
}
コード例 #2
0
END_TEST


START_TEST (test_Event_setName2)
{
  const char *name = "Set k2";

  int i = Event_setName(E, name);

  fail_unless( i == LIBSBML_OPERATION_SUCCESS );
  fail_unless( !strcmp(Event_getName(E), name) );
  fail_unless( Event_isSetName(E) );

  i = Event_unsetName(E);


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