ipa_timerules-tests.c revision 9cbcc60997b3d9fd6c5c17f956bc90aac1abba70
/*
Timelib
Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _XOPEN_SOURCE /* strptime */
#include <check.h>
#include <popt.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <stdbool.h>
#include "providers/ipa/ipa_timerules.h"
check_leaks_push(ctx); \
check_leaks_pop(ctx); \
} while (0)
static TALLOC_CTX *ctx;
{
}
{
char *err;
return EINVAL;
}
/* Fixtures - open the time library before every test, close it afterwards */
void setup(void)
{
}
void teardown(void)
{
}
/* Test that timelib detects a time rule inside the absolute range */
{
int ret;
bool result;
}
/* Test that timelib detects a time rule outside the absolute range */
{
int ret;
bool result;
}
/* Test that absolute timeranges work OK with only minimal data supplied */
{
int ret;
bool result;
}
/* Test a time value "right off the edge" of the time specifier */
{
int ret;
bool result;
fail_unless(str2time_t("%Y-%m-%d-%H-%M-%S", "1994-12-16-10-32-29", &now) == 0, "Cannot parse time spec");
fail_unless(str2time_t("%Y-%m-%d-%H-%M-%S", "1994-12-16-10-32-32", &now) == 0, "Cannot parse time spec");
}
/* Test a time value "right on the edge" of the time specifier */
{
int ret;
bool result;
fail_unless(str2time_t("%Y-%m-%d-%H-%M-%S", "1994-12-16-10-32-30", &now) == 0, "Cannot parse time spec");
fail_unless(str2time_t("%Y-%m-%d-%H-%M-%S", "1994-12-16-10-32-31", &now) == 0, "Cannot parse time spec");
}
{
int ret;
bool result;
/* test edges */
/* test wrap around */
}
{
int ret;
bool result;
/* test one-off errors */
/* test wrap around */
}
{
int ret;
bool result;
/* test edges - monday */
/* test edges - friday */
/* test wrap around */
}
{
int ret;
bool result;
/* test one-off error - monday */
/* test one-off error - friday */
/* test wrap around */
}
{
int ret;
bool result;
/* edges - week in */
/* edges - day in */
}
{
int ret;
bool result;
/* one-off error - week out */
/* one-off error - day out */
}
{
int ret;
bool result;
}
{
int ret;
bool result;
}
Suite *create_timelib_suite(void)
{
/* Add setup() and teardown() methods */
/* Do some testing */
/* Add all test cases to the test suite */
return s;
}
{
int ret;
int failure_count;
int debug = 0;
struct poptOption long_options[] = {
};
return EXIT_FAILURE;
}
debug_level = debug;
/* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
}