~svn/ubuntu/oneiric/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/tests/libsvn_subr/target-test.c

  • Committer: Max Bowsher
  • Date: 2012-06-27 12:25:12 UTC
  • mfrom: (44.1.46 precise)
  • Revision ID: _@maxb.eu-20120627122512-kmo8fj0lr7mlkppj
Make tree identical to precise branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * target-test.c: test the condense_targets functions
3
3
 *
4
4
 * ====================================================================
5
 
 * Copyright (c) 2000-2008 CollabNet.  All rights reserved.
6
 
 *
7
 
 * This software is licensed as described in the file COPYING, which
8
 
 * you should have received as part of this distribution.  The terms
9
 
 * are also available at http://subversion.tigris.org/license-1.html.
10
 
 * If newer versions of this license are posted there, you may use a
11
 
 * newer version instead, at your option.
12
 
 *
13
 
 * This software consists of voluntary contributions made by many
14
 
 * individuals.  For exact contribution history, see the revision
15
 
 * history and logs, available at http://subversion.tigris.org/.
 
5
 *    Licensed to the Apache Software Foundation (ASF) under one
 
6
 *    or more contributor license agreements.  See the NOTICE file
 
7
 *    distributed with this work for additional information
 
8
 *    regarding copyright ownership.  The ASF licenses this file
 
9
 *    to you under the Apache License, Version 2.0 (the
 
10
 *    "License"); you may not use this file except in compliance
 
11
 *    with the License.  You may obtain a copy of the License at
 
12
 *
 
13
 *      http://www.apache.org/licenses/LICENSE-2.0
 
14
 *
 
15
 *    Unless required by applicable law or agreed to in writing,
 
16
 *    software distributed under the License is distributed on an
 
17
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
18
 *    KIND, either express or implied.  See the License for the
 
19
 *    specific language governing permissions and limitations
 
20
 *    under the License.
16
21
 * ====================================================================
17
22
 */
18
23
 
26
31
#include <unistd.h> /* for getcwd() */
27
32
#endif
28
33
 
 
34
#define SVN_DEPRECATED
 
35
 
29
36
#include "svn_pools.h"
30
37
#include "svn_path.h"
31
38
 
59
66
  apr_array_header_t *targets;
60
67
  apr_array_header_t *condensed_targets;
61
68
  const char *common_path, *common_path2, *curdir;
62
 
  char *token, *iter, *exp_common_abs = (char*)exp_common;
 
69
  char *token, *iter;
 
70
  const char *exp_common_abs = exp_common;
63
71
  int i;
64
72
  char buf[8192];
65
73
 
83
91
 
84
92
  /* Verify the common part with the expected (prefix with cwd). */
85
93
  if (*exp_common == '%')
86
 
    exp_common_abs = apr_pstrcat(pool, curdir, exp_common + 1, NULL);
 
94
    exp_common_abs = apr_pstrcat(pool, curdir, exp_common + 1, (char *)NULL);
87
95
 
88
96
  if (strcmp(common_path, exp_common_abs) != 0)
89
97
    {
100
108
    {
101
109
      const char * target = APR_ARRAY_IDX(condensed_targets, i, const char*);
102
110
      if (token && (*token == '%'))
103
 
        token = apr_pstrcat(pool, curdir, token + 1, NULL);
 
111
        token = apr_pstrcat(pool, curdir, token + 1, (char *)NULL);
104
112
      if (! token ||
105
113
          (target && (strcmp(target, token) != 0)))
106
114
        {
132
140
 
133
141
 
134
142
static svn_error_t *
135
 
test_path_condense_targets(const char **msg,
136
 
                           svn_boolean_t msg_only,
137
 
                           svn_test_opts_t *opts,
138
 
                           apr_pool_t *pool)
 
143
test_path_condense_targets(apr_pool_t *pool)
139
144
{
140
145
  int i;
141
146
  struct {
169
174
     "", "%/z/A,http://host/A/C" },
170
175
  };
171
176
 
172
 
  *msg = "test svn_path_condense_targets";
173
 
 
174
 
  if (msg_only)
175
 
    return SVN_NO_ERROR;
176
 
 
177
177
  for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
178
178
    {
179
179
      SVN_ERR(condense_targets_tests_helper(tests[i].title,
195
195
struct svn_test_descriptor_t test_funcs[] =
196
196
  {
197
197
    SVN_TEST_NULL,
198
 
    SVN_TEST_PASS(test_path_condense_targets),
 
198
    SVN_TEST_PASS2(test_path_condense_targets,
 
199
                   "test svn_path_condense_targets"),
199
200
    SVN_TEST_NULL
200
201
  };