2
* named_atomic-test-proc.c: a collection of svn_named_atomic__t tests
4
* ====================================================================
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
13
* http://www.apache.org/licenses/LICENSE-2.0
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
21
* ====================================================================
24
/* ====================================================================
25
To add tests, look toward the bottom of this file.
31
/* shared test implementation */
32
#include "named_atomic-test-common.h"
34
/* Very simple process frame around the actual test code */
36
main(int argc, const char *argv[])
38
svn_boolean_t got_error = FALSE;
46
/* Initialize APR (Apache pools) */
47
if (apr_initialize() != APR_SUCCESS)
49
printf("apr_initialize() failed.\n");
53
pool = svn_pool_create(NULL);
55
/* lean & mean parameter parsing */
58
if (argc == 1) /* used to test that this executable can be started */
61
printf("Usage: named_atomic-proc-test ID COUNT ITERATIONS NS.\n");
65
id = (int)apr_atoi64(argv[1]);
66
count = (int)apr_atoi64(argv[2]);
67
iterations = (int)apr_atoi64(argv[3]);
68
name_namespace = argv[4];
70
/* run test routine */
72
err = test_pipeline(id, count, iterations, pool);
75
const char *prefix = apr_psprintf(pool, "Process %d: ", id);
77
svn_handle_error2(err, stdout, FALSE, prefix);
82
svn_pool_destroy(pool);