subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1550816 - in /subversion/trunk/subversion: libsvn_client/mtcc.c tests/libsvn_client/mtcc-test.c
Date Fri, 13 Dec 2013 19:19:57 GMT
Author: rhuijben
Date: Fri Dec 13 19:19:57 2013
New Revision: 1550816

URL: http://svn.apache.org/r1550816
Log:
Add regression test for the property handling via the new mtcc api.

* subversion/libsvn_client/mtcc.c
  (mtcc_op_find): Don't segfault when created is NULL.

* subversion/tests/libsvn_client/mtcc-test.c
  (test_swap): Fix whitespace.
  (test_propset): New test.
  (test_list): Add test_propset.

Modified:
    subversion/trunk/subversion/libsvn_client/mtcc.c
    subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c

Modified: subversion/trunk/subversion/libsvn_client/mtcc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mtcc.c?rev=1550816&r1=1550815&r2=1550816&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mtcc.c (original)
+++ subversion/trunk/subversion/libsvn_client/mtcc.c Fri Dec 13 19:19:57 2013
@@ -75,7 +75,8 @@ mtcc_op_find(svn_client_mtcc_op_t **op,
   int i;
 
   assert(svn_relpath_is_canonical(relpath));
-  *created = FALSE;
+  if (created)
+    *created = FALSE;
 
   if (!*relpath)
     {

Modified: subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c?rev=1550816&r1=1550815&r2=1550816&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_client/mtcc-test.c Fri Dec 13 19:19:57 2013
@@ -175,7 +175,7 @@ static svn_error_t *
 test_swap(const svn_test_opts_t *opts,
           apr_pool_t *pool)
 {
- svn_client_mtcc_t *mtcc;
+  svn_client_mtcc_t *mtcc;
   svn_client_ctx_t *ctx;
   const char *repos_abspath;
   const char *repos_url;
@@ -200,6 +200,44 @@ test_swap(const svn_test_opts_t *opts,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_propset(const svn_test_opts_t *opts,
+             apr_pool_t *pool)
+{
+  svn_client_mtcc_t *mtcc;
+  svn_client_ctx_t *ctx;
+  const char *repos_abspath;
+  const char *repos_url;
+  svn_repos_t* repos;
+
+  repos_abspath = svn_test_data_path("mtcc-propset", pool);
+  SVN_ERR(svn_dirent_get_absolute(&repos_abspath, repos_abspath, pool));
+  SVN_ERR(svn_uri_get_file_url_from_dirent(&repos_url, repos_abspath, pool));
+  SVN_ERR(svn_test__create_repos(&repos, repos_abspath, opts, pool));
+
+  SVN_ERR(make_greek_tree(repos_url, pool));
+
+  SVN_ERR(svn_client_create_context2(&ctx, NULL, pool));
+  SVN_ERR(svn_client_mtcc_create(&mtcc, repos_url, 1, ctx, pool, pool));
+
+  SVN_ERR(svn_client_mtcc_add_propset("iota", "key",
+                                      svn_string_create("val", pool), FALSE,
+                                      mtcc, pool));
+  SVN_ERR(svn_client_mtcc_add_propset("A", "A-key",
+                                      svn_string_create("val-A", pool), FALSE,
+                                      mtcc, pool));
+  SVN_ERR(svn_client_mtcc_add_propset("A/B", "B-key",
+                                      svn_string_create("val-B", pool), FALSE,
+                                      mtcc, pool));
+
+  /* The repository ignores propdeletes of properties that aren't there,
+     so this just works */
+  SVN_ERR(svn_client_mtcc_add_propset("A/D", "D-key", NULL, FALSE,
+                                      mtcc, pool));
+
+  SVN_ERR(verify_mtcc_commit(mtcc, 2, pool));
+  return SVN_NO_ERROR;
+}
 
 /* ========================================================================== */
 
@@ -215,6 +253,8 @@ struct svn_test_descriptor_t test_funcs[
                        "test making greek tree"),
     SVN_TEST_OPTS_PASS(test_swap,
                        "swapping some trees"),
+    SVN_TEST_OPTS_PASS(test_propset,
+                       "test propset and propdel"),
     SVN_TEST_NULL
   };
  



Mime
View raw message