コード例 #1
0
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
ファイル: TestL3Model.c プロジェクト: kirichoi/roadrunner
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.");
  }
}