You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/10/30 19:20:11 UTC
svn commit: r1537225 -
/subversion/trunk/subversion/tests/libsvn_subr/config-test.c
Author: rhuijben
Date: Wed Oct 30 18:20:10 2013
New Revision: 1537225
URL: http://svn.apache.org/r1537225
Log:
Construct paths in a proper way in the config tests.
* subversion/tests/libsvn_subr/config-test.c
(includes): Add svn_dirent_uri.h.
(test_text_retrieval,
test_boolean_retrieval,
test_has_section_case_insensitive,
test_has_section_case_sensitive,
test_has_option_case_sensitive,
test_stream_interface,
test_read_only_mode): Use svn_dirent_join to join paths.
Modified:
subversion/trunk/subversion/tests/libsvn_subr/config-test.c
Modified: subversion/trunk/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/config-test.c?rev=1537225&r1=1537224&r2=1537225&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/config-test.c Wed Oct 30 18:20:10 2013
@@ -33,6 +33,7 @@
#include <apr_getopt.h>
#include <apr_pools.h>
+#include "svn_dirent_uri.h"
#include "svn_error.h"
#include "svn_config.h"
#include "private/svn_subr_private.h"
@@ -71,8 +72,7 @@ test_text_retrieval(const svn_test_opts_
int i;
const char *cfg_file;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
/* Test values retrieved from our ConfigParser instance against
@@ -121,8 +121,7 @@ test_boolean_retrieval(const svn_test_op
int i;
const char *cfg_file;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
for (i = 0; true_keys[i] != NULL; i++)
@@ -180,8 +179,7 @@ test_has_section_case_insensitive(const
svn_config_t *cfg;
const char *cfg_file;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, FALSE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
@@ -209,8 +207,7 @@ test_has_section_case_sensitive(const sv
svn_config_t *cfg;
const char *cfg_file;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, FALSE, pool));
if (! svn_config_has_section(cfg, "section1"))
@@ -251,8 +248,7 @@ test_has_option_case_sensitive(const svn
};
static const int test_data_size = sizeof(test_data)/sizeof(*test_data);
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, TRUE, pool));
for (i = 0; i < test_data_size; ++i)
@@ -280,8 +276,7 @@ test_stream_interface(const svn_test_opt
const char *cfg_file;
svn_stream_t *stream;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_stream_open_readonly(&stream, cfg_file, pool, pool));
SVN_ERR(svn_config_parse(&cfg, stream, TRUE, TRUE, pool));
@@ -319,8 +314,7 @@ test_read_only_mode(const svn_test_opts_
svn_config_t *cfg2;
const char *cfg_file;
- cfg_file = apr_pstrcat(pool, opts->srcdir, "/", "config-test.cfg",
- SVN_VA_NULL);
+ cfg_file = svn_dirent_join(opts->srcdir, "config-test.cfg", pool);
SVN_ERR(svn_config_read3(&cfg, cfg_file, TRUE, TRUE, FALSE, pool));
/* setting CFG to r/o mode shall toggle the r/o mode and expand values */