~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to unittests/generator.cc

added generator for TemporalFormat
added tests for TemporalFormat

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "config.h"
22
22
 
23
23
#include <drizzled/temporal.h>
 
24
#include <drizzled/temporal_format.h>
24
25
 
25
26
#include "generator.h"
26
27
 
128
129
  make_timestamp(timestamp, years, months, days, hours, minutes, seconds);
129
130
  timestamp->set_nseconds(nanoseconds);
130
131
}
 
132
 
 
133
drizzled::TemporalFormat *Generator::TemporalFormatGen::make_temporal_format(const char *regexp,
 
134
                                                                  int32_t year_part_index,
 
135
                                                                  int32_t month_part_index,
 
136
                                                                  int32_t day_part_index,
 
137
                                                                  int32_t hour_part_index,
 
138
                                                                  int32_t minute_part_index,
 
139
                                                                  int32_t second_part_index,
 
140
                                                                  int32_t usecond_part_index,
 
141
                                                                  int32_t nsecond_part_index)
 
142
{
 
143
  drizzled::TemporalFormat *temporal_format= new drizzled::TemporalFormat(regexp);
 
144
  
 
145
  temporal_format->set_year_part_index(year_part_index);
 
146
  temporal_format->set_month_part_index(month_part_index);
 
147
  temporal_format->set_day_part_index(day_part_index);
 
148
  temporal_format->set_hour_part_index(hour_part_index);
 
149
  temporal_format->set_minute_part_index(minute_part_index);
 
150
  temporal_format->set_second_part_index(second_part_index);
 
151
  temporal_format->set_usecond_part_index(usecond_part_index);
 
152
  temporal_format->set_nsecond_part_index(nsecond_part_index);
 
153
 
 
154
  return temporal_format;
 
155
}
 
 
b'\\ No newline at end of file'