~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/tests/libsvn_delta/random-test.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
{
110
110
  apr_status_t apr_err;
111
111
  apr_file_t *fp = NULL;
112
 
  char *templ;
113
 
 
114
 
  if (!name_template)
115
 
    templ = apr_pstrdup(pool, "tempfile_XXXXXX");
116
 
  else
117
 
    templ = apr_pstrdup(pool, name_template);
 
112
  char *templ = (char *)apr_pstrdup(
 
113
      pool, svn_test_data_path(
 
114
          name_template ? name_template : "tempfile_XXXXXX", pool));
118
115
 
119
116
  apr_err = apr_file_mktemp(&fp, templ, 0, pool);
120
117
  assert(apr_err == 0);
283
280
 
284
281
 
285
282
 
286
 
/* Implements svn_test_driver_t. */
 
283
/* (Note: *LAST_SEED is an output parameter.) */
287
284
static svn_error_t *
288
 
random_test(apr_pool_t *pool)
 
285
do_random_test(apr_pool_t *pool,
 
286
               apr_uint32_t *last_seed)
289
287
{
290
288
  apr_uint32_t seed, maxlen;
291
289
  apr_size_t bytes_range;
300
298
  for (i = 0; i < iterations; i++)
301
299
    {
302
300
      /* Generate source and target for the delta and its application.  */
303
 
      apr_uint32_t subseed_base = svn_test_rand(&seed);
 
301
      apr_uint32_t subseed_base = svn_test_rand((*last_seed = seed, &seed));
304
302
      apr_file_t *source = generate_random_file(maxlen, subseed_base, &seed,
305
303
                                                random_bytes, bytes_range,
306
304
                                                dump_files, pool);
360
358
  return SVN_NO_ERROR;
361
359
}
362
360
 
 
361
/* Implements svn_test_driver_t. */
 
362
static svn_error_t *
 
363
random_test(apr_pool_t *pool)
 
364
{
 
365
  apr_uint32_t seed;
 
366
  svn_error_t *err = do_random_test(pool, &seed);
 
367
  if (err)
 
368
    fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
 
369
  return err;
 
370
}
 
371
 
363
372
 
364
373
 
365
374
/* (Note: *LAST_SEED is an output parameter.) */
500
509
{
501
510
  apr_uint32_t seed;
502
511
  svn_error_t *err = do_random_combine_test(pool, &seed);
 
512
  if (err)
 
513
    fprintf(stderr, "SEED: %lu\n", (unsigned long)seed);
503
514
  return err;
504
515
}
505
516
 
513
524
 
514
525
/* The test table.  */
515
526
 
516
 
struct svn_test_descriptor_t test_funcs[] =
 
527
static int max_threads = 1;
 
528
 
 
529
static struct svn_test_descriptor_t test_funcs[] =
517
530
  {
518
531
    SVN_TEST_NULL,
519
532
    SVN_TEST_PASS2(random_test,
526
539
#endif
527
540
    SVN_TEST_NULL
528
541
  };
 
542
 
 
543
SVN_TEST_MAIN