1
/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Pawel Blokus
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef UNITTESTS_GENERATOR_H
22
#define UNITTESTS_GENERATOR_H
38
class TemporalGenerator
45
static void leap_day_in_leap_year(drizzled::Temporal *temporal);
46
static void leap_day_in_non_leap_year(drizzled::Temporal *temporal);
47
static void make_min_time(drizzled::Temporal *temporal);
48
static void make_max_time(drizzled::Temporal *temporal);
54
static void make_date(drizzled::Date *date, uint32_t years, uint32_t months, uint32_t days);
55
static void make_valid_date(drizzled::Date *date);
61
static void make_time(drizzled::Time *time, uint32_t hours, uint32_t minutes, uint32_t seconds,
62
uint32_t useconds = 0);
68
static void make_datetime(drizzled::DateTime *datetime,
69
uint32_t years, uint32_t months, uint32_t days, uint32_t hours,
70
uint32_t minutes, uint32_t seconds, uint32_t useconds = 0);
71
static void make_valid_datetime(drizzled::DateTime *datetime);
77
static void make_timestamp(drizzled::Timestamp *timestamp,
78
uint32_t years, uint32_t months, uint32_t days, uint32_t hours,
79
uint32_t minutes, uint32_t seconds);
80
static void make_micro_timestamp(drizzled::MicroTimestamp *timestamp,
81
uint32_t years, uint32_t months, uint32_t days, uint32_t hours,
82
uint32_t minutes, uint32_t seconds, uint32_t microseconds);
83
static void make_nano_timestamp(drizzled::NanoTimestamp *timestamp,
84
uint32_t years, uint32_t months, uint32_t days, uint32_t hours,
85
uint32_t minutes, uint32_t seconds, uint32_t nanoseconds);
88
class TemporalFormatGen
91
static drizzled::TemporalFormat *make_temporal_format(const char *regexp,
92
int32_t year_part_index,
93
int32_t month_part_index,
94
int32_t day_part_index,
95
int32_t hour_part_index,
96
int32_t minute_part_index,
97
int32_t second_part_index,
98
int32_t usecond_part_index,
99
int32_t nsecond_part_index);
102
class TemporalIntervalGen
105
static drizzled::TemporalInterval *make_temporal_interval(
112
uint64_t second_part,
117
#endif /*UNITTESTS_GENERATOR_H*/
b'\\ No newline at end of file'