END_TEST


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


  fail_unless( !Model_isSetId(P) );
  
  Model_setId(P, id);

  const char* getchar = Model_getId(P);
  fail_unless( !strcmp(getchar, id) );
  fail_unless( Model_isSetId(P) );

  if (getchar == id)
  {
    fail("Model_setId(...) did not make a copy of string.");
  }
 
  Model_unsetId(P);
  
  fail_unless( !Model_isSetId(P) );

  if (Model_getId(P) != NULL)
  {
    fail("Model_unsetId(P) did not clear string.");
  }
}
示例#2
0
END_TEST


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


  fail_unless( !Model_isSetId(M) );
  
  Model_setId(M, id);

  fail_unless( !strcmp(Model_getId(M), id) );
  fail_unless( Model_isSetId(M) );

  if (Model_getId(M) == id)
  {
    fail("Model_setId(...) did not make a copy of string.");
  }
 
  Model_unsetId(M);
  
  fail_unless( !Model_isSetId(M) );

  if (Model_getId(M) != NULL)
  {
    fail("Model_unsetId(M) did not clear string.");
  }
}