Don't configure MySQL if the driver isn't there.
[apr-util.git] / test / testdaterfc.c
blob4a0f9c108e208f3555db205c2375c59b327466b6
1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
2 * applicable.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "testutil.h"
18 #include "apr_date.h"
20 struct datetest {
21 const char *input;
22 const char *output;
23 } tests[] = {
24 { "Mon, 27 Feb 1995 20:49:44 -0800", "Tue, 28 Feb 1995 04:49:44 GMT" },
25 { "Fri, 1 Jul 2005 11:34:25 -0400", "Fri, 01 Jul 2005 15:34:25 GMT" },
26 { "Monday, 27-Feb-95 20:49:44 -0800", "Tue, 28 Feb 1995 04:49:44 GMT" },
27 { "Tue, 4 Mar 1997 12:43:52 +0200", "Tue, 04 Mar 1997 10:43:52 GMT" },
28 { "Mon, 27 Feb 95 20:49:44 -0800", "Tue, 28 Feb 1995 04:49:44 GMT" },
29 { "Tue, 4 Mar 97 12:43:52 +0200", "Tue, 04 Mar 1997 10:43:52 GMT" },
30 { "Tue, 4 Mar 97 12:43:52 +0200", "Tue, 04 Mar 1997 10:43:52 GMT" },
31 { "Mon, 27 Feb 95 20:49 GMT", "Mon, 27 Feb 1995 20:49:00 GMT" },
32 { "Tue, 4 Mar 97 12:43 GMT", "Tue, 04 Mar 1997 12:43:00 GMT" },
33 { NULL, NULL }
36 static void test_date_rfc(abts_case *tc, void *data)
38 apr_time_t date;
39 int i = 0;
41 while (tests[i].input) {
42 char str_date[APR_RFC822_DATE_LEN] = { 0 };
44 date = apr_date_parse_rfc(tests[i].input);
46 apr_rfc822_date(str_date, date);
48 ABTS_STR_EQUAL(tc, str_date, tests[i].output);
50 i++;
54 abts_suite *testdaterfc(abts_suite *suite)
56 suite = ADD_SUITE(suite);
58 abts_run_test(suite, test_date_rfc, NULL);
60 return suite;