Modified: subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.c?rev=1502106&r1=1502105&r2=1502106&view=diff ============================================================================== --- subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.c (original) +++ subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.c Thu Jul 11 04:06:08 2013 @@ -516,6 +516,42 @@ svn_test__validate_tree(svn_fs_root_t *r svn_error_t * +svn_test__validate_changes(svn_fs_root_t *root, + apr_hash_t *expected, + apr_pool_t *pool) +{ + apr_hash_t *actual; + apr_hash_index_t *hi; + + SVN_ERR(svn_fs_paths_changed2(&actual, root, pool)); + +#if 0 + /* Print ACTUAL and EXPECTED. */ + { + int i; + for (i=0, hi = apr_hash_first(pool, expected); hi; hi = apr_hash_next(hi)) + SVN_DBG(("expected[%d] = '%s'\n", i++, svn__apr_hash_index_key(hi))); + for (i=0, hi = apr_hash_first(pool, actual); hi; hi = apr_hash_next(hi)) + SVN_DBG(("actual[%d] = '%s'\n", i++, svn__apr_hash_index_key(hi))); + } +#endif + + for (hi = apr_hash_first(pool, expected); hi; hi = apr_hash_next(hi)) + if (NULL == svn_hash_gets(actual, svn__apr_hash_index_key(hi))) + return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, + "Path '%s' missing from actual changed-paths", + svn__apr_hash_index_key(hi)); + + for (hi = apr_hash_first(pool, actual); hi; hi = apr_hash_next(hi)) + if (NULL == svn_hash_gets(expected, svn__apr_hash_index_key(hi))) + return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, + "Path '%s' missing from expected changed-paths", + svn__apr_hash_index_key(hi)); + + return SVN_NO_ERROR; +} + +svn_error_t * svn_test__txn_script_exec(svn_fs_root_t *txn_root, svn_test__txn_script_command_t *script, int num_edits,
Modified: subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.h URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.h?rev=1502106&r1=1502105&r2=1502106&view=diff ============================================================================== --- subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.h (original) +++ subversion/branches/1.8.x-busted-proxy/subversion/tests/svn_test_fs.h Thu Jul 11 04:06:08 2013 @@ -112,6 +112,14 @@ svn_test__validate_tree(svn_fs_root_t *r int num_entries, apr_pool_t *pool); +/* Verify that svn_fs_paths_changed2(ROOT) returns a hash with exactly + the same keys as EXPECTED_KEYS. Values are not currently verified. + */ +svn_error_t * +svn_test__validate_changes(svn_fs_root_t *root, + apr_hash_t *expected_keys, + apr_pool_t *pool); + /* Structure for describing script-ish commands to perform on a transaction using svn_test__txn_script_exec(). */ typedef struct svn_test__txn_script_command_t
