[Nagios-devel] [PATCH 3/6] test_timeperiods: Remove TODO,

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH 3/6] test_timeperiods: Remove TODO,

Post by Guest »

There are no more todos here - the tests pass. Their output was
very unhelpful, though, so making that more helpful as well.

Signed-off-by: Robin Sonefors
---
t-tap/test_timeperiods.c | 50 ++++++++++++++++--------------------------------
1 file changed, 16 insertions(+), 34 deletions(-)

diff --git a/t-tap/test_timeperiods.c b/t-tap/test_timeperiods.c
index 9663231..e660855 100644
--- a/t-tap/test_timeperiods.c
+++ b/t-tap/test_timeperiods.c
@@ -195,56 +195,40 @@ int main(int argc, char **argv) {

/* Timeperiod exclude tests, from Jean Gabes */
temp_timeperiod = find_timeperiod("Test_exclude");
- ok(temp_timeperiod != NULL, "ME: Testing Exclude timeperiod");
+ ok(temp_timeperiod != NULL, "Testing Exclude timeperiod");
test_time = 1278939600; //mon jul 12 15:00:00
- /* printf("Testing at time %s", ctime(&test_time)); */
is_valid_time = check_time_against_period(test_time, temp_timeperiod);
- ok(is_valid_time == ERROR, "ME: 12 Jul 2010 15:00:00 - false");
+ ok(is_valid_time == ERROR, "12 Jul 2010 15:00:00 should not be valid");

_get_next_valid_time(test_time, test_time, &chosen_valid_time, temp_timeperiod);
- /* printf("JEAN: Got chosent time at %s", ctime(&chosen_valid_time)); */
- todo_start("Bug in exclude");
- ok(chosen_valid_time == 1288103400, "ME: Next valid time=Tue Oct 26 16:30:00 2010, was %i", chosen_valid_time);
- todo_end();
+ ok(chosen_valid_time == 1288103400, "Next valid time should be Tue Oct 26 16:30:00 2010, was %s", ctime(&chosen_valid_time));


temp_timeperiod = find_timeperiod("Test_exclude2");
- ok(temp_timeperiod != NULL, "ME: Testing Exclude timeperiod 2");
- test_time = 1278939600;
- /* printf("Testing at time %s", ctime(&test_time)); */
+ ok(temp_timeperiod != NULL, "Testing Exclude timeperiod 2");
+ test_time = 1278939600; //mon jul 12 15:00:00
is_valid_time = check_time_against_period(test_time, temp_timeperiod);
- ok(is_valid_time == ERROR, "ME: 12 Jul 2010 15:00:00 - false");
+ ok(is_valid_time == ERROR, "12 Jul 2010 15:00:00 should not be valid");
_get_next_valid_time(test_time, test_time, &chosen_valid_time, temp_timeperiod);
- /* printf("JEAN: Got chosent time at %s", ctime(&chosen_valid_time)); */
- todo_start("Bug in exclude 2");
- ok(chosen_valid_time == 1279058340, "ME: Next valid time=Tue Jul 13 23:59:00 2010");
- todo_end();
+ ok(chosen_valid_time == 1279058340, "Next valid time should be Tue Jul 13 23:59:00 2010, was %s", ctime(&chosen_valid_time));


temp_timeperiod = find_timeperiod("Test_exclude3");
- ok(temp_timeperiod != NULL, "ME: Testing Exclude timeperiod 3");
- test_time = 1278939600;
- /* printf("Testing at time %s", ctime(&test_time)); */
+ ok(temp_timeperiod != NULL, "Testing Exclude timeperiod 3");
+ test_time = 1278939600; //mon jul 12 15:00:00
is_valid_time = check_time_against_period(test_time, temp_timeperiod);
- ok(is_valid_time == ERROR, "ME: 12 Jul 2010 15:00:00 - false");
+ ok(is_valid_time == ERROR, "12 Jul 2010 15:00:00 should not be valid");
_get_next_valid_time(test_time, test_time, &chosen_valid_time, temp_timeperiod);
- /* printf("JEAN: Got chosent time at %s", ctime(&chosen_valid_time)); */
- todo_start("Bug in exclude 3");
- ok(chosen_valid_time == 1284474600, "ME: Next valid time=Tue Sep 14 16:30:00 2010");
- todo_end();
+ ok(chosen_valid_time == 1284474600, "Next valid time should be Tue Sep 14 16:30:00 2010, was %s", ctime(&chosen_valid_time));


temp_timeperiod = find_timeperiod("Test_exclude4");
- ok(temp_timeperiod != NULL, "ME: Testing Exclude timeperiod 4");
- test_time = 1278939600;
- /* printf("Testing at time %s", ctime(&test_time)); */
+ ok(temp_timeperiod != NULL, "Testing Exclude timeperiod 4");
+ test_time = 1278939600; //mon jul 12 15:00:00
is_valid_time = check_time_against_period(test_time, temp_timeperiod);
- ok(is_valid_time == ERROR, "ME: 12 Jul 2010 15:00:00 - false");
+ ok(is_valid_time == ERROR, "12 Jul 2010 15:00:00 should not be valid");
_get_next_valid_time(test_time, test_time, &chosen_valid_time, temp_timeperiod);
- /* printf("JEAN: Got chosent time at %s", ctime(&chosen_valid_time)); */
- todo_star

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: robin.sonefors@op5.com
Locked