Esempio n. 1
0
END_TEST


START_TEST (test_comp_deletion_free_NULL)
{
  Deletion_free(NULL);
}
Esempio n. 2
0
END_TEST


START_TEST (test_comp_submodel_deletion)
{
  Deletion_t *deletion = Deletion_create(3, 1, 1);
  const char* delname = "deletion";
  SBaseRef_setIdRef((SBaseRef_t*)deletion, "ref_id");


  fail_unless( Submodel_getNumDeletions(P) == 0 );

  Submodel_addDeletion(P, deletion);

  Deletion_t* getdel = Submodel_getDeletion(P, 0);
  fail_unless( getdel != NULL);
  fail_unless( Submodel_getNumDeletions(P)==1 );

  if (getdel == deletion)
  {
    fail("Submodel_addDeletion(...) did not make a copy of the deletion.");
  }
  Deletion_free(getdel);

  Submodel_removeDeletion(P, 0);
  
  fail_unless( Submodel_getDeletion(P, 0) == NULL);
  fail_unless( Submodel_getNumDeletions(P)==0 );

  Deletion_setId(deletion, delname);

  Submodel_addDeletion(P, deletion);
  fail_unless( Submodel_getDeletionById(P, delname) != NULL);

  Deletion_t* remdel = Submodel_removeDeletionById(P, delname);
  Deletion_free(remdel);
	
  fail_unless( Submodel_getDeletionById(P, delname) == NULL);
  fail_unless( Submodel_getNumDeletions(P)==0 );

  Deletion_free(deletion);
}
Esempio n. 3
0
END_TEST


START_TEST (test_comp_deletion_hasRequiredAttributes )
{
  Deletion_t *P = Deletion_create (3, 1, 1);

  fail_unless ( !Deletion_hasRequiredAttributes(P));

  Deletion_setId(P, "p");

  fail_unless ( !Deletion_hasRequiredAttributes(P));

  SBaseRef_setIdRef((SBaseRef_t*)(P), "s");
  
  fail_unless ( Deletion_hasRequiredAttributes(P));

  Deletion_free(P);
}
Esempio n. 4
0
void
DeletionTest_teardown (void)
{
  Deletion_free(P);
}