Apache HTTPD
testud.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#include <stdio.h>
18#include <stdlib.h>
19#include "apr_file_io.h"
20#include "apr_errno.h"
21#include "apr_general.h"
22#include "apr_lib.h"
23#include "apr_strings.h"
24#include "testutil.h"
25
27static char *testdata;
28static int cleanup_called = 0;
29
31{
33 return APR_SUCCESS;
34}
35
36static void set_userdata(abts_case *tc, void *data)
37{
38 apr_status_t rv;
39
42}
43
44static void get_userdata(abts_case *tc, void *data)
45{
46 apr_status_t rv;
47 void *retdata;
48
49 rv = apr_pool_userdata_get(&retdata, "TEST", pool);
52}
53
54static void get_nonexistkey(abts_case *tc, void *data)
55{
56 apr_status_t rv;
57 void *retdata;
58
59 rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
62}
63
64static void post_pool_clear(abts_case *tc, void *data)
65{
66 apr_status_t rv;
67 void *retdata;
68
69 rv = apr_pool_userdata_get(&retdata, "DOESNTEXIST", pool);
72}
73
75{
76 suite = ADD_SUITE(suite)
77
79 testdata = apr_pstrdup(pool, "This is a test\n");
80
84
86
88
89 return suite;
90}
91
void abts_run_test(abts_suite *ts, test_func f, void *value)
Definition abts.c:175
#define ABTS_PTR_EQUAL(a, b, c)
Definition abts.h:126
#define ADD_SUITE(suite)
Definition abts.h:67
#define ABTS_STR_EQUAL(a, b, c)
Definition abts.h:123
#define ABTS_INT_EQUAL(a, b, c)
Definition abts.h:109
APR Error Codes.
APR File I/O Handling.
APR Miscellaneous library routines.
APR general purpose library routines.
APR Strings library.
apr_size_t size
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
void * data
#define apr_pool_create(newpool, parent)
Definition apr_pools.h:322
apr_pool_t * p
Definition md_event.c:32
return NULL
Definition mod_so.c:359
static void post_pool_clear(abts_case *tc, void *data)
Definition testud.c:64
static int cleanup_called
Definition testud.c:28
static void set_userdata(abts_case *tc, void *data)
Definition testud.c:36
static apr_pool_t * pool
Definition testud.c:26
static void get_nonexistkey(abts_case *tc, void *data)
Definition testud.c:54
abts_suite * testud(abts_suite *suite)
Definition testud.c:74
static apr_status_t string_cleanup(void *data)
Definition testud.c:30
static char * testdata
Definition testud.c:27
static void get_userdata(abts_case *tc, void *data)
Definition testud.c:44