Exemple #1
0
int main(){

	int value = -1;	
    
	value = test_create_queue();

	if(value == 1) printf("Sucesso create_queue\n");
	else printf("Erro create_queue\n");
	
	value = -1;

	value = test_add_element_queue();

	if(value > 0) printf("Sucesso add_element_queue\n");
	else printf("Erro add_element_queue\n");

	test_get_elements_queue();
	
	test_isEmpty_full();
	
	test_isEmpty_not_full();	

	test_clear_queue();

	test_destroy_queue();

return 0;
}
int main(){
	fixtureSetup();
	resetTestCount();

	testStarted("test_create_queue");
	setup();
		test_create_queue();
	tearDown();
	testEnded();
	testStarted("test_insert_integer_data_in_Start_of_queue");
	setup();
		test_insert_integer_data_in_Start_of_queue();
	tearDown();
	testEnded();
	testStarted("test_insert_integer_data_in_queue1");
	setup();
		test_insert_integer_data_in_queue1();
	tearDown();
	testEnded();
	testStarted("test_insert_float_data_in_queue1");
	setup();
		test_insert_float_data_in_queue1();
	tearDown();
	testEnded();
	testStarted("test_insert_string_data_in_queue1");
	setup();
		test_insert_string_data_in_queue1();
	tearDown();
	testEnded();
	testStarted("test_delete_integer_data_in_queue1");
	setup();
		test_delete_integer_data_in_queue1();
	tearDown();
	testEnded();
	testStarted("test_delete_float_data_in_queue1");
	setup();
		test_delete_float_data_in_queue1();
	tearDown();
	testEnded();
	testStarted("test_delete_string_data_in_queue");
	setup();
		test_delete_string_data_in_queue();
	tearDown();
	testEnded();

	summarizeTestCount();
	fixtureTearDown();
	return 0;
}
Exemple #3
0
/****** test_category/test_create_job() ****************************************
*  NAME
*     test_create_job() -- creates a job object
*
*  SYNOPSIS
*     lListElem* test_create_job(data_entry_t *test, int count) 
*
*  FUNCTION
*     ??? 
*
*  INPUTS
*     data_entry_t *test - string representation of a job
*     int count          - multiplier for the requests
*
*  RESULT
*     lListElem* - NULL or valid job object
*
*  NOTES
*     MT-NOTE: test_create_job() is MT safe 
*
*******************************************************************************/
static lListElem *test_create_job(data_entry_t *test, int count) 
{
   lListElem *job = NULL;

   job = lCreateElem(JB_Type);

   if (job != NULL) {
      lSetUlong(job, JB_type, test->type);

      if (test->project != NULL) {
         lSetString(job, JB_project, test->project);
      }
      if (test->owner != NULL) {
         lSetString(job, JB_owner, test->owner);
      }
      if (test->group != NULL) {
         lSetString(job, JB_group, test->group);
      }
      if (test->checkpointing != NULL) {
         lSetString(job, JB_checkpoint_name, test->checkpointing);
      }
      if (test->hard_resource_list != NULL) {
         lList *requests = test_create_request(test->hard_resource_list, count);
         if (requests != NULL) {
            lSetList(job, JB_hard_resource_list, requests);
         }
         else {
            lFreeElem(&job);
            goto end;
         }
      }
      if (test->soft_resource_list != NULL) {
         lList *requests = test_create_request(test->soft_resource_list, count);
         if (requests != NULL) {
            lSetList(job, JB_soft_resource_list, requests);
         }
         else {
            lFreeElem(&job);
            goto end;
         }
      }
      if (test->hard_queue_list != NULL) {
         lList *queues = test_create_queue(test->hard_queue_list, count);
         if (queues != NULL) {
            lSetList(job, JB_hard_queue_list, queues);
         }
         else {
            lFreeElem(&job);
            goto end;
         }
      }
      if (test->hard_master_queue_list != NULL) {
         lList *queues = test_create_queue(test->hard_master_queue_list, count);
         if (queues != NULL) {
            lSetList(job, JB_master_hard_queue_list, queues);
         }
         else {
            lFreeElem(&job);
            goto end;
         }
      }
      if (test->pe != NULL) {
         test_create_pe(test->pe, job);
      }
   }
end:
   return job;
}