FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testScheduler.c File Reference

Unit test for scheduler operations. More...

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

Go to the source code of this file.

Functions

int Prepare_Testing_Data_Scheduler (scheduler_t *scheduler)
 
void test_scheduler_sig_handle ()
 Test for scheduler_sig_handle() More...
 
void test_string_is_num ()
 Test for string_is_num() More...
 
void test_scheduler_daemonize ()
 Test for scheduler_daemonize() More...
 
void test_scheduler_clear_config ()
 Test for scheduler_clear_config() More...
 

Variables

CU_TestInfo tests_scheduler []
 

Detailed Description

Unit test for scheduler operations.

Definition in file testScheduler.c.

Function Documentation

◆ Prepare_Testing_Data_Scheduler()

int Prepare_Testing_Data_Scheduler ( scheduler_t scheduler)

Local function for testing data prepare

Definition at line 21 of file testScheduler.c.

◆ test_scheduler_clear_config()

void test_scheduler_clear_config ( )

Test for scheduler_clear_config()

Test:
  1. Initialize scheduler and database
  2. Call scheduler_clear_config()
  3. Check for config pointers to be NULL

Definition at line 106 of file testScheduler.c.

◆ test_scheduler_daemonize()

void test_scheduler_daemonize ( )

Test for scheduler_daemonize()

Test:
  1. Initialize scheduler and database
  2. Call scheduler_daemonize(), the return should be OK
  3. Call kill_scheduler(), the return should be -1

Definition at line 79 of file testScheduler.c.

◆ test_scheduler_sig_handle()

void test_scheduler_sig_handle ( )

Test for scheduler_sig_handle()

Test:
  1. Initialize scheduler and database
  2. Call scheduler_sig_handle() and scheduler_signal()

Definition at line 37 of file testScheduler.c.

◆ test_string_is_num()

void test_string_is_num ( )

Test for string_is_num()

Test:
  1. Call string_is_num() on a text, the return should be 0 (FALSE)
  2. Call string_is_num() on a number, the return should be 1 (TRUE)

Definition at line 59 of file testScheduler.c.

Variable Documentation

◆ tests_scheduler

CU_TestInfo tests_scheduler[]
Initial value:
=
{
{"Test scheduler_sig_handle", test_scheduler_sig_handle },
{"Test string is number", test_string_is_num },
{"Test scheduler_clear_config", test_scheduler_clear_config },
CU_TEST_INFO_NULL
}
void test_scheduler_sig_handle()
Test for scheduler_sig_handle()
Definition: testScheduler.c:37
void test_scheduler_clear_config()
Test for scheduler_clear_config()
void test_string_is_num()
Test for string_is_num()
Definition: testScheduler.c:59

Definition at line 233 of file testScheduler.c.