FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testJob.c File Reference

Unit test for job operations. More...

#include <testRun.h>
#include <scheduler.h>
#include <job.h>
#include <utils.h>
Include dependency graph for testJob.c:

Go to the source code of this file.

Functions

int Prepare_Testing_Data_Job (scheduler_t *scheduler)
 
void test_job_event ()
 Test for job events. More...
 
void test_job_fun ()
 Test for job functions. More...
 

Variables

CU_TestInfo tests_job []
 

Detailed Description

Unit test for job operations.

Definition in file testJob.c.

Function Documentation

int Prepare_Testing_Data_Job ( scheduler_t scheduler)

Local function for testing data prepare

Definition at line 34 of file testJob.c.

void test_job_event ( )

Test for job events.

Test:
  1. Initialize scheduler and database
  2. Create new database_update_event() to load data
  3. Get the job from scheduler and call
    1. job_verbose_event() and check if job is updated
    2. job_pause_event() and check if job is paused
    3. job_restart_event() and check if job is restarted
    4. job_priority_event() and check if job is restarted
    5. job_fail_event() and check if job is failed

Definition at line 54 of file testJob.c.

void test_job_fun ( )

Test for job functions.

Test:
  1. Initialize scheduler and database
  2. Create new database_update_event() to load data
  3. Get the job from scheduler and call
    1. job_next() and check the job queue id
    2. next_job() and check the job is NOT NULL and its id is 1
    3. peek_job() and check the job is NOT NULL and its id is 1
    4. active_jobs() and check the result is 0

Definition at line 113 of file testJob.c.

Variable Documentation

CU_TestInfo tests_job[]
Initial value:
=
{
{"Test job_event", test_job_event },
{"Test job_fun", test_job_fun },
CU_TEST_INFO_NULL
}
void test_job_event()
Test for job events.
Definition: testJob.c:54
void test_job_fun()
Test for job functions.
Definition: testJob.c:113

Definition at line 151 of file testJob.c.