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 B570E17741 for ; Thu, 29 Jan 2015 17:23:19 +0000 (UTC) Received: (qmail 73176 invoked by uid 500); 29 Jan 2015 17:23:20 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 73146 invoked by uid 500); 29 Jan 2015 17:23:20 -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 73134 invoked by uid 99); 29 Jan 2015 17:23:20 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jan 2015 17:23:20 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id C0555AC003E; Thu, 29 Jan 2015 17:23:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1655755 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Date: Thu, 29 Jan 2015 17:23:19 -0000 To: commits@subversion.apache.org From: ivan@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150129172319.C0555AC003E@hades.apache.org> Author: ivan Date: Thu Jan 29 17:23:19 2015 New Revision: 1655755 URL: http://svn.apache.org/r1655755 Log: Add another regression test for issue #4554: Wrong file length with PLAIN representations in FSFS. * subversion/tests/libsvn_fs/fs-test.c (test_prop_and_text_rep_sharing_collision): New test. (test_funcs): Add test_prop_and_text_rep_sharing_collision test to the test list. Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/fs-test.c?rev=1655755&r1=1655754&r2=1655755&view=diff ============================================================================== --- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original) +++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Thu Jan 29 17:23:19 2015 @@ -6696,6 +6696,56 @@ test_modify_txn_being_written(const svn_ return SVN_NO_ERROR; } +static svn_error_t * +test_prop_and_text_rep_sharing_collision(const svn_test_opts_t *opts, + apr_pool_t *pool) +{ + /* Regression test for issue 4554: Wrong file length with PLAIN + * representations in FSFS. */ + svn_fs_t *fs; + svn_fs_txn_t *txn; + svn_fs_root_t *txn_root; + svn_fs_root_t *rev_root; + svn_revnum_t new_rev; + svn_filesize_t length; + const char *testdir = "test-prop-and-text-rep-sharing-collision"; + + /* Create a new repo. */ + SVN_ERR(svn_test__create_fs(&fs, testdir, opts, pool)); + + SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool)); + SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool)); + /* Set node property for the root. */ + SVN_ERR(svn_fs_change_node_prop(txn_root, "/", "prop", + svn_string_create("value", pool), + pool)); + + /* Commit revision r1. */ + SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool)); + + SVN_ERR(svn_fs_begin_txn(&txn, fs, 1, pool)); + SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool)); + + /* Create file with same contents as property representation. */ + SVN_ERR(svn_fs_make_file(txn_root, "/foo", pool)); + SVN_ERR(svn_test__set_file_contents(txn_root, "/foo", + "K 4\n" + "prop\n" + "V 5\n" + "value\n" + "END\n", pool)); + + /* Commit revision r2. */ + SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool)); + + /* Check that FS reports correct length for the file (23). */ + SVN_ERR(svn_fs_revision_root(&rev_root, fs, 2, pool)); + SVN_ERR(svn_fs_file_length(&length, rev_root, "/foo", pool)); + + SVN_TEST_ASSERT(length == 23); + return SVN_NO_ERROR; +} + /* ------------------------------------------------------------------------ */ /* The test table. */ @@ -6825,6 +6875,8 @@ static struct svn_test_descriptor_t test "test pool lifetime dependencies with txn roots"), SVN_TEST_OPTS_PASS(test_modify_txn_being_written, "test modify txn being written in FSFS"), + SVN_TEST_OPTS_PASS(test_prop_and_text_rep_sharing_collision, + "test property and text rep-sharing collision"), SVN_TEST_NULL };