Skip to content

Commit 252ef02

Browse files
authored
Fix some things in test stubs (#1008)
1 parent 55ae275 commit 252ef02

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

t-tap/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ test_commands
99
test_downtime
1010
test_strtoul
1111
test_notifications
12+
test_stubs
1213
*.dSYM

t-tap/test-stubs.c t-tap/test_stubs.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef NAGIOS_TEST_STUBS__
22
#define NAGIOS_TEST_STUBS__
33
#include "macros.h"
4+
#include "defaults.h"
5+
#include "logging.h"
46

57
/* Loads of variables + stubbed functions */
68
char *config_file = "etc/nagios.cfg";
@@ -67,7 +69,8 @@ int save_state_information(int int1) {}
6769
int check_for_external_commands(void) {}
6870
int check_time_against_period(time_t time_t1, timeperiod *timeperiod) {}
6971
time_t get_next_log_rotation_time(void) {}
70-
int handle_scheduled_downtime_by_id(unsigned long long1) {}
72+
int handle_scheduled_downtime_start_by_id(unsigned long long1) {}
73+
int handle_scheduled_downtime_end_by_id(unsigned long long1) {}
7174
#ifndef TEST_LOGGING
7275
int log_host_event(host *hst) {}
7376
int log_service_event_flag = 0;
@@ -119,10 +122,10 @@ int update_service_status(service *svc, int aggregated_dump) {}
119122
int update_all_status_data(void) {}
120123
char *check_result_path = NULL;
121124
int process_check_result_queue(char *dirname) {}
122-
service * find_service(char *host_name, char *svc_desc) {}
125+
struct service * find_service(const char *host_name, const char *svc_desc) {}
123126
int delete_check_result_file(char *fname) {}
124127
int free_check_result(check_result *info) {}
125-
host * find_host(char *name) {}
128+
struct host * find_host(const char *name) {}
126129
int max_check_reaper_time = DEFAULT_MAX_REAPER_TIME;
127130
check_result *read_check_result(void) {}
128131
int broker_service_check(int type, int flags, int attr, service *svc, int check_type, struct timeval start_time, struct timeval end_time, char *cmd, double latency, double exectime, int timeout, int early_timeout, int retcode, char *cmdline, struct timeval *timestamp) {}
@@ -183,5 +186,6 @@ int passive_host_checks_are_soft = DEFAULT_PASSIVE_HOST_CHECKS_SOFT;
183186
int translate_passive_host_checks = DEFAULT_TRANSLATE_PASSIVE_HOST_CHECKS;
184187
int enable_predictive_host_dependency_checks = DEFAULT_ENABLE_PREDICTIVE_HOST_DEPENDENCY_CHECKS;
185188

189+
int main() {}
186190

187191
#endif

0 commit comments

Comments
 (0)