Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E457C1010B for ; Fri, 13 Dec 2013 19:20:21 +0000 (UTC) Received: (qmail 85359 invoked by uid 500); 13 Dec 2013 19:20:21 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 85334 invoked by uid 500); 13 Dec 2013 19:20:21 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 85327 invoked by uid 99); 13 Dec 2013 19:20:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 19:20:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Dec 2013 19:20:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D57742388868; Fri, 13 Dec 2013 19:19:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131213191957.D57742388868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 };