You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2022/02/09 14:48:00 UTC
svn commit: r1897907 - in /subversion/branches/multi-wc-format/subversion/tests: libsvn_client/client-test.c libsvn_client/conflicts-test.c libsvn_wc/db-test.c libsvn_wc/entries-compat.c libsvn_wc/utils.c libsvn_wc/utils.h libsvn_wc/wc-queries-test.c
Author: julianfoad
Date: Wed Feb 9 14:47:59 2022
New Revision: 1897907
URL: http://svn.apache.org/viewvc?rev=1897907&view=rev
Log:
On the 'multi-wc-format' branch: C tests use '--wc-format-version' option.
This patch uses the passed in '--wc-format-version' option value when
creating working copies, throughout the C tests.
* subversion/tests/libsvn_client/client-test.c,
subversion/tests/libsvn_client/conflicts-test.c,
subversion/tests/libsvn_wc/db-test.c,
subversion/tests/libsvn_wc/entries-compat.c,
subversion/tests/libsvn_wc/wc-queries-test.c
(create_*,
test_*,
test_funcs): Pass wc-format-version from test opts through to WC creation.
* subversion/tests/libsvn_wc/utils.h,
subversion/tests/libsvn_wc/utils.c
(svn_test__create_fake_wc): Pass wc-format-version through to WC creation.
Modified:
subversion/branches/multi-wc-format/subversion/tests/libsvn_client/client-test.c
subversion/branches/multi-wc-format/subversion/tests/libsvn_client/conflicts-test.c
subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/db-test.c
subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/entries-compat.c
subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.c
subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.h
subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/wc-queries-test.c
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_client/client-test.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_client/client-test.c Wed Feb 9 14:47:59 2022
@@ -389,9 +389,10 @@ test_patch(const svn_test_opts_t *opts,
rev.kind = svn_opt_revision_head;
peg_rev.kind = svn_opt_revision_unspecified;
SVN_ERR(svn_client_create_context(&ctx, pool));
- SVN_ERR(svn_client_checkout3(NULL, repos_url, wc_path,
+ SVN_ERR(svn_client_checkout4(NULL, repos_url, wc_path,
&peg_rev, &rev, svn_depth_infinity,
- TRUE, FALSE, ctx, pool));
+ TRUE, FALSE,
+ opts->wc_format_version, ctx, pool));
/* Create the patch file. */
patch_file_path = svn_dirent_join_many(
@@ -463,14 +464,15 @@ test_wc_add_scenarios(const svn_test_opt
peg_rev.kind = svn_opt_revision_unspecified;
SVN_ERR(svn_client_create_context(&ctx, pool));
/* Checkout greek tree as wc_path */
- SVN_ERR(svn_client_checkout3(NULL, repos_url, wc_path, &peg_rev, &rev,
- svn_depth_infinity, FALSE, FALSE, ctx, pool));
+ SVN_ERR(svn_client_checkout4(NULL, repos_url, wc_path, &peg_rev, &rev,
+ svn_depth_infinity, FALSE, FALSE,
+ opts->wc_format_version, ctx, pool));
/* Now checkout again as wc_path/NEW */
new_dir_path = svn_dirent_join(wc_path, "NEW", pool);
- SVN_ERR(svn_client_checkout3(NULL, repos_url, new_dir_path, &peg_rev, &rev,
+ SVN_ERR(svn_client_checkout4(NULL, repos_url, new_dir_path, &peg_rev, &rev,
svn_depth_infinity, FALSE, FALSE,
- ctx, pool));
+ opts->wc_format_version, ctx, pool));
ex_dir_path = svn_dirent_join(wc_path, "NEW_add", pool);
ex2_dir_path = svn_dirent_join(wc_path, "NEW_add2", pool);
@@ -627,9 +629,10 @@ test_16k_add(const svn_test_opts_t *opts
rev.kind = svn_opt_revision_head;
peg_rev.kind = svn_opt_revision_unspecified;
SVN_ERR(svn_client_create_context(&ctx, pool));
- SVN_ERR(svn_client_checkout3(NULL, repos_url, wc_path,
+ SVN_ERR(svn_client_checkout4(NULL, repos_url, wc_path,
&peg_rev, &rev, svn_depth_infinity,
- TRUE, FALSE, ctx, pool));
+ TRUE, FALSE,
+ opts->wc_format_version, ctx, pool));
for (i = 0; i < 16384; i++)
{
@@ -757,8 +760,10 @@ test_foreign_repos_copy(const svn_test_o
peg_rev.kind = svn_opt_revision_unspecified;
SVN_ERR(svn_client_create_context(&ctx, pool));
/* Checkout greek tree as wc_path */
- SVN_ERR(svn_client_checkout3(NULL, repos_url, wc_path, &peg_rev, &rev,
- svn_depth_infinity, FALSE, FALSE, ctx, pool));
+ SVN_ERR(svn_client_checkout4(NULL, repos_url, wc_path, &peg_rev, &rev,
+ svn_depth_infinity,
+ FALSE, FALSE,
+ opts->wc_format_version, ctx, pool));
SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &loc,
repos2_url, NULL, &peg_rev, &rev,
@@ -822,12 +827,12 @@ test_suggest_mergesources(const svn_test
SVN_ERR(svn_io_remove_dir2(wc_path, TRUE, NULL, NULL, pool));
head_rev.kind = svn_opt_revision_head;
- SVN_ERR(svn_client_checkout3(NULL,
+ SVN_ERR(svn_client_checkout4(NULL,
svn_path_url_add_component2(repos_url, "AA", pool),
wc_path,
&head_rev, &head_rev, svn_depth_empty,
- FALSE, FALSE, ctx, pool));
-
+ FALSE, FALSE,
+ opts->wc_format_version, ctx, pool));
SVN_ERR(svn_client_suggest_merge_sources(&results,
wc_path,
@@ -970,10 +975,11 @@ test_remote_only_status(const svn_test_o
rev.kind = svn_opt_revision_number;
rev.value.number = 1;
- SVN_ERR(svn_client_checkout3(NULL,
+ SVN_ERR(svn_client_checkout4(NULL,
apr_pstrcat(pool, repos_url, "/A", SVN_VA_NULL),
wc_path, &rev, &rev, svn_depth_immediates,
- FALSE, FALSE, ctx, pool));
+ FALSE, FALSE,
+ opts->wc_format_version, ctx, pool));
/* Add a local file; this is a double-check to make sure that
remote-only status ignores local changes. */
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_client/conflicts-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_client/conflicts-test.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_client/conflicts-test.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_client/conflicts-test.c Wed Feb 9 14:47:59 2022
@@ -6113,10 +6113,11 @@ test_file_vs_dir_move_merge_assertion_fa
opt_rev.value.number = SVN_INVALID_REVNUM;
peg_rev.kind = svn_opt_revision_unspecified;
SVN_ERR(svn_test__create_client_ctx(&ctx, b, pool));
- SVN_ERR(svn_client_checkout3(NULL, svn_path_url_add_component2(b->repos_url,
+ SVN_ERR(svn_client_checkout4(NULL, svn_path_url_add_component2(b->repos_url,
"A1", pool),
wc_path, &peg_rev, &opt_rev, svn_depth_infinity,
- TRUE, FALSE, ctx, pool));
+ TRUE, FALSE,
+ opts->wc_format_version, ctx, pool));
SVN_ERR(svn_client_merge_peg5(svn_path_url_add_component2(b->repos_url, "A",
pool),
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/db-test.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/db-test.c Wed Feb 9 14:47:59 2022
@@ -292,6 +292,7 @@ static svn_error_t *
create_open(svn_wc__db_t **db,
const char **local_abspath,
const char *subdir,
+ const svn_test_opts_t *opts,
apr_pool_t *pool)
{
SVN_ERR(svn_dirent_get_absolute(local_abspath,
@@ -304,7 +305,8 @@ create_open(svn_wc__db_t **db,
SVN_ERR(svn_wc__db_open(db, NULL, FALSE, TRUE, pool, pool));
SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA,
- nodes_init_data, actual_init_data, pool));
+ nodes_init_data, actual_init_data,
+ opts->wc_format_version, pool));
svn_test_add_dir_cleanup(*local_abspath);
@@ -339,7 +341,8 @@ validate_abspath(const char *wcroot_absp
static svn_error_t *
-test_getting_info(apr_pool_t *pool)
+test_getting_info(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_node_kind_t kind;
@@ -361,7 +364,7 @@ test_getting_info(apr_pool_t *pool)
svn_wc__db_t *db;
svn_error_t *err;
- SVN_ERR(create_open(&db, &local_abspath, "test_getting_info", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_getting_info", opts, pool));
/* Test: basic fetching of data. */
SVN_ERR(svn_wc__db_base_get_info(
@@ -596,7 +599,8 @@ validate_node(svn_wc__db_t *db,
static svn_error_t *
-test_inserting_nodes(apr_pool_t *pool)
+test_inserting_nodes(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_checksum_t *checksum;
@@ -604,7 +608,7 @@ test_inserting_nodes(apr_pool_t *pool)
apr_hash_t *props;
const apr_array_header_t *children;
- SVN_ERR(create_open(&db, &local_abspath, "test_insert_nodes", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_insert_nodes", opts, pool));
props = apr_hash_make(pool);
set_prop(props, "p1", "v1", pool);
@@ -721,14 +725,15 @@ test_inserting_nodes(apr_pool_t *pool)
static svn_error_t *
-test_children(apr_pool_t *pool)
+test_children(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_wc__db_t *db;
const apr_array_header_t *children;
int i;
- SVN_ERR(create_open(&db, &local_abspath, "test_children", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_children", opts, pool));
SVN_ERR(svn_wc__db_base_get_children(&children,
db, local_abspath,
@@ -773,7 +778,8 @@ test_children(apr_pool_t *pool)
static svn_error_t *
-test_working_info(apr_pool_t *pool)
+test_working_info(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_node_kind_t kind;
@@ -805,7 +811,7 @@ test_working_info(apr_pool_t *pool)
svn_wc__db_lock_t *lock;
svn_wc__db_t *db;
- SVN_ERR(create_open(&db, &local_abspath, "test_working_info", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_working_info", opts, pool));
/* Test: basic fetching of data. */
SVN_ERR(svn_wc__db_read_info(
@@ -880,12 +886,13 @@ test_working_info(apr_pool_t *pool)
static svn_error_t *
-test_pdh(apr_pool_t *pool)
+test_pdh(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_wc__db_t *db;
- SVN_ERR(create_open(&db, &local_abspath, "test_pdh", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_pdh", opts, pool));
/* NOTE: this test doesn't do anything apparent -- it simply exercises
some internal functionality of wc_db. This is a handy driver for
@@ -917,7 +924,8 @@ test_pdh(apr_pool_t *pool)
static svn_error_t *
-test_scan_addition(apr_pool_t *pool)
+test_scan_addition(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_wc__db_t *db;
@@ -935,7 +943,7 @@ test_scan_addition(apr_pool_t *pool)
const char *move_op_root_src;
const char *delete_op_root_abspath;
- SVN_ERR(create_open(&db, &local_abspath, "test_scan_addition", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_scan_addition", opts, pool));
/* Simple addition of a directory. */
SVN_ERR(svn_wc__db_scan_addition(
@@ -1069,7 +1077,8 @@ test_scan_addition(apr_pool_t *pool)
static svn_error_t *
-test_scan_deletion(apr_pool_t *pool)
+test_scan_deletion(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_wc__db_t *db;
@@ -1078,7 +1087,7 @@ test_scan_deletion(apr_pool_t *pool)
const char *moved_to_abspath;
const char *copy_op_root_abspath;
- SVN_ERR(create_open(&db, &local_abspath, "test_scan_deletion", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_scan_deletion", opts, pool));
/* Node was moved elsewhere. */
SVN_ERR(svn_wc__db_scan_deletion(
@@ -1248,7 +1257,8 @@ test_scan_deletion(apr_pool_t *pool)
static svn_error_t *
-test_global_relocate(apr_pool_t *pool)
+test_global_relocate(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *local_abspath;
svn_wc__db_t *db;
@@ -1256,7 +1266,7 @@ test_global_relocate(apr_pool_t *pool)
const char *repos_root_url;
const char *repos_uuid;
- SVN_ERR(create_open(&db, &local_abspath, "test_global_relocate", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_global_relocate", opts, pool));
/* Initial sanity check. */
SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL,
@@ -1338,7 +1348,8 @@ detect_work_item(const svn_skel_t *work_
static svn_error_t *
-test_work_queue(apr_pool_t *pool)
+test_work_queue(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_wc__db_t *db;
const char *local_abspath;
@@ -1347,7 +1358,7 @@ test_work_queue(apr_pool_t *pool)
int fetches = 0;
apr_int64_t last_id = 0;
- SVN_ERR(create_open(&db, &local_abspath, "test_work_queue", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_work_queue", opts, pool));
/* Create three work items. */
work_item = svn_skel__make_empty_list(pool);
@@ -1403,7 +1414,8 @@ test_work_queue(apr_pool_t *pool)
}
static svn_error_t *
-test_externals_store(apr_pool_t *pool)
+test_externals_store(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_wc__db_t *db;
const char *local_abspath;
@@ -1416,7 +1428,7 @@ test_externals_store(apr_pool_t *pool)
apr_hash_set(props, "key", APR_HASH_KEY_STRING, value);
- SVN_ERR(create_open(&db, &local_abspath, "test_externals_store", pool));
+ SVN_ERR(create_open(&db, &local_abspath, "test_externals_store", opts, pool));
/* Directory I exists in the standard test db */
subdir = svn_dirent_join(local_abspath, "I", pool);
@@ -1530,26 +1542,26 @@ static int max_threads = 2;
static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
- SVN_TEST_PASS2(test_getting_info,
- "get information from wc.db"),
- SVN_TEST_PASS2(test_inserting_nodes,
- "insert different nodes into wc.db"),
- SVN_TEST_PASS2(test_children,
- "getting the list of BASE or WORKING children"),
- SVN_TEST_PASS2(test_working_info,
- "reading information about the WORKING tree"),
- SVN_TEST_PASS2(test_pdh,
- "creation of per-directory handles"),
- SVN_TEST_PASS2(test_scan_addition,
- "scanning added working nodes"),
- SVN_TEST_PASS2(test_scan_deletion,
- "deletion introspection functions"),
- SVN_TEST_PASS2(test_global_relocate,
- "relocating a node"),
- SVN_TEST_PASS2(test_work_queue,
- "work queue processing"),
- SVN_TEST_PASS2(test_externals_store,
- "externals store"),
+ SVN_TEST_OPTS_PASS(test_getting_info,
+ "get information from wc.db"),
+ SVN_TEST_OPTS_PASS(test_inserting_nodes,
+ "insert different nodes into wc.db"),
+ SVN_TEST_OPTS_PASS(test_children,
+ "getting the list of BASE or WORKING children"),
+ SVN_TEST_OPTS_PASS(test_working_info,
+ "reading information about the WORKING tree"),
+ SVN_TEST_OPTS_PASS(test_pdh,
+ "creation of per-directory handles"),
+ SVN_TEST_OPTS_PASS(test_scan_addition,
+ "scanning added working nodes"),
+ SVN_TEST_OPTS_PASS(test_scan_deletion,
+ "deletion introspection functions"),
+ SVN_TEST_OPTS_PASS(test_global_relocate,
+ "relocating a node"),
+ SVN_TEST_OPTS_PASS(test_work_queue,
+ "work queue processing"),
+ SVN_TEST_OPTS_PASS(test_externals_store,
+ "externals store"),
SVN_TEST_NULL
};
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/entries-compat.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/entries-compat.c Wed Feb 9 14:47:59 2022
@@ -287,7 +287,9 @@ static const char * const M_TESTING_DATA
static svn_error_t *
-create_fake_wc(const char *subdir, apr_pool_t *pool)
+create_fake_wc(const char *subdir,
+ const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
const char *root;
const char *wc_abspath;
@@ -298,7 +300,7 @@ create_fake_wc(const char *subdir, apr_p
SVN_ERR(svn_dirent_get_absolute(&wc_abspath, root, pool));
SVN_ERR(svn_test__create_fake_wc(wc_abspath, TESTING_DATA, nodes, actuals,
- pool));
+ opts->wc_format_version, pool));
return SVN_NO_ERROR;
}
@@ -308,9 +310,10 @@ static svn_error_t *
create_open(svn_wc__db_t **db,
const char **local_abspath,
const char *subdir,
+ const svn_test_opts_t *opts,
apr_pool_t *pool)
{
- SVN_ERR(create_fake_wc(subdir, pool));
+ SVN_ERR(create_fake_wc(subdir, opts, pool));
SVN_ERR(svn_dirent_get_absolute(local_abspath,
svn_dirent_join("fake-wc", subdir, pool),
@@ -328,7 +331,8 @@ create_open(svn_wc__db_t **db,
static svn_error_t *
-test_entries_alloc(apr_pool_t *pool)
+test_entries_alloc(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_wc__db_t *db;
const char *local_abspath;
@@ -340,7 +344,7 @@ test_entries_alloc(apr_pool_t *pool)
#undef WC_NAME
#define WC_NAME "test_entries_alloc"
- SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool));
+ SVN_ERR(create_open(&db, &local_abspath, WC_NAME, opts, pool));
SVN_ERR(svn_wc_adm_open3(&adm_access,
NULL /* associated */,
@@ -375,7 +379,8 @@ test_entries_alloc(apr_pool_t *pool)
static svn_error_t *
-test_stubs(apr_pool_t *pool)
+test_stubs(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_wc__db_t *db;
const char *local_abspath;
@@ -391,10 +396,11 @@ test_stubs(apr_pool_t *pool)
#undef WC_NAME
#define WC_NAME "test_stubs"
- SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool));
+ SVN_ERR(create_open(&db, &local_abspath, WC_NAME, opts, pool));
M_dir = svn_dirent_join(local_abspath, "M", pool);
- SVN_ERR(svn_test__create_fake_wc(M_dir, M_TESTING_DATA, NULL, NULL, pool));
+ SVN_ERR(svn_test__create_fake_wc(M_dir, M_TESTING_DATA, NULL, NULL,
+ opts->wc_format_version, pool));
/* The "M" entry is a subdir. Let's ensure we can reach its stub,
and the actual contents. */
@@ -454,7 +460,8 @@ test_stubs(apr_pool_t *pool)
}
static svn_error_t *
-test_access_baton_like_locking(apr_pool_t *pool)
+test_access_baton_like_locking(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
{
svn_wc__db_t *db;
svn_wc_context_t *wc_ctx, *wc_ctx2;
@@ -466,7 +473,7 @@ test_access_baton_like_locking(apr_pool_
#undef WC_NAME
#define WC_NAME "test_access_batons"
- SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool));
+ SVN_ERR(create_open(&db, &local_abspath, WC_NAME, opts, pool));
D = svn_dirent_join(local_abspath, "DD", pool);
@@ -595,6 +602,7 @@ test_access_baton_like_locking(apr_pool_
{
const char *url, *repos_root_url, *repos_uuid;
const char *subdir = svn_dirent_join(local_abspath, "sub-wc", pool);
+ int target_format;
const char *repos_relpath;
svn_boolean_t is_root;
@@ -605,9 +613,13 @@ test_access_baton_like_locking(apr_pool_
url = svn_path_url_add_component2(repos_root_url, repos_relpath, pool);
SVN_ERR(svn_io_make_dir_recursively(subdir, pool));
- SVN_ERR(svn_wc_ensure_adm3(subdir, repos_uuid,
+ SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
+ pool));
+ SVN_ERR(svn_wc__ensure_adm(wc_ctx, target_format,
+ subdir,
svn_path_url_add_component2(url, "sub-wc", pool),
- repos_root_url, 0, svn_depth_infinity,
+ repos_root_url, repos_uuid,
+ 0, svn_depth_infinity,
pool));
SVN_ERR(svn_wc__db_is_switched(&is_root, NULL, NULL, wc_ctx->db, subdir,
@@ -635,12 +647,12 @@ static int max_threads = -1;
static struct svn_test_descriptor_t test_funcs[] =
{
SVN_TEST_NULL,
- SVN_TEST_PASS2(test_entries_alloc,
- "entries are allocated in access baton"),
- SVN_TEST_PASS2(test_stubs,
- "access baton mojo can return stubs"),
- SVN_TEST_PASS2(test_access_baton_like_locking,
- "access baton like locks must work with wc-ng"),
+ SVN_TEST_OPTS_PASS(test_entries_alloc,
+ "entries are allocated in access baton"),
+ SVN_TEST_OPTS_PASS(test_stubs,
+ "access baton mojo can return stubs"),
+ SVN_TEST_OPTS_PASS(test_access_baton_like_locking,
+ "access baton like locks must work with wc-ng"),
SVN_TEST_NULL
};
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.c Wed Feb 9 14:47:59 2022
@@ -107,7 +107,7 @@ create_repos_and_wc(const char **repos_u
&head_rev, &head_rev, svn_depth_infinity,
FALSE /* ignore_externals */,
FALSE /* allow_unver_obstructions */,
- /* TODO: */NULL /* wc_format_verison */,
+ opts->wc_format_version,
ctx, subpool));
svn_pool_destroy(subpool);
}
@@ -125,7 +125,7 @@ svn_test__create_fake_wc(const char *wc_
const char *extra_statements,
const svn_test__nodes_data_t nodes[],
const svn_test__actual_data_t actuals[],
-
+ const svn_version_t *wc_format_version,
apr_pool_t *scratch_pool)
{
const char *dotsvn_abspath = svn_dirent_join(wc_abspath, ".svn",
@@ -135,14 +135,21 @@ svn_test__create_fake_wc(const char *wc_
int i;
svn_sqlite__stmt_t *stmt;
const apr_int64_t wc_id = 1;
+ int target_format;
+
+ SVN_ERR(svn_wc__format_from_version(&target_format, wc_format_version,
+ scratch_pool));
/* Allocate MY_STATEMENTS in RESULT_POOL because the SDB will continue to
* refer to it over its lifetime. */
my_statements = apr_palloc(scratch_pool, 7 * sizeof(const char *));
- my_statements[0] = statements[STMT_CREATE_SCHEMA];
- my_statements[1] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
- my_statements[2] = extra_statements;
- my_statements[3] = NULL;
+ i = 0;
+ my_statements[i++] = statements[STMT_CREATE_SCHEMA];
+ if (target_format >= 32)
+ my_statements[i++] = statements[STMT_UPGRADE_TO_32];
+ my_statements[i++] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
+ my_statements[i++] = extra_statements;
+ my_statements[i++] = NULL;
/* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
SVN_ERR(svn_io_make_dir_recursively(dotsvn_abspath, scratch_pool));
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.h?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/utils.h Wed Feb 9 14:47:59 2022
@@ -227,6 +227,7 @@ svn_test__create_fake_wc(const char *wc_
const char *extra_statements,
const svn_test__nodes_data_t nodes[],
const svn_test__actual_data_t actuals[],
+ const svn_version_t *wc_format_version,
apr_pool_t *scratch_pool);
Modified: subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1897907&r1=1897906&r2=1897907&view=diff
==============================================================================
--- subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/multi-wc-format/subversion/tests/libsvn_wc/wc-queries-test.c Wed Feb 9 14:47:59 2022
@@ -25,6 +25,7 @@
#include "svn_hash.h"
#include "svn_ctype.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_wc_private.h"
#include "svn_private_config.h"
@@ -70,6 +71,7 @@ static const int schema_statements[] =
{
/* Usual tables */
STMT_CREATE_SCHEMA,
+ /* (executing STMT_UPGRADE_TO_xx is conditional on desired WC format) */
STMT_UPGRADE_TO_32,
STMT_INSTALL_SCHEMA_STATISTICS,
/* Memory tables */
@@ -150,10 +152,15 @@ in_list(const int list[], int stmt_idx)
/* Create an in-memory db for evaluating queries */
static svn_error_t *
create_memory_db(sqlite3 **db,
+ const svn_test_opts_t *opts,
apr_pool_t *pool)
{
sqlite3 *sdb;
int i;
+ int target_format;
+
+ SVN_ERR(svn_wc__format_from_version(&target_format, opts->wc_format_version,
+ pool));
/* Create an in-memory raw database */
SVN_TEST_ASSERT(sqlite3_initialize() == SQLITE_OK);
@@ -164,6 +171,8 @@ create_memory_db(sqlite3 **db,
/* Create schema */
for (i = 0; schema_statements[i] != -1; i++)
{
+ if (target_format < 32 && schema_statements[i] == STMT_UPGRADE_TO_32)
+ continue;
SQLITE_ERR(sqlite3_exec(sdb, wc_queries[schema_statements[i]], NULL, NULL, NULL));
}
@@ -208,12 +217,13 @@ test_sqlite_version(apr_pool_t *scratch_
/* Parse all normal queries */
static svn_error_t *
-test_parsable(apr_pool_t *scratch_pool)
+test_parsable(const svn_test_opts_t *opts,
+ apr_pool_t *scratch_pool)
{
sqlite3 *sdb;
int i;
- SVN_ERR(create_memory_db(&sdb, scratch_pool));
+ SVN_ERR(create_memory_db(&sdb, opts, scratch_pool));
for (i=0; i < STMT_SCHEMA_FIRST; i++)
{
@@ -632,7 +642,8 @@ is_result_table(const char *table_name)
}
static svn_error_t *
-test_query_expectations(apr_pool_t *scratch_pool)
+test_query_expectations(const svn_test_opts_t *opts,
+ apr_pool_t *scratch_pool)
{
sqlite3 *sdb;
int i;
@@ -640,7 +651,7 @@ test_query_expectations(apr_pool_t *scra
svn_error_t *warnings = NULL;
svn_boolean_t supports_query_info;
- SVN_ERR(create_memory_db(&sdb, scratch_pool));
+ SVN_ERR(create_memory_db(&sdb, opts, scratch_pool));
SVN_ERR(supported_explain_query_plan(&supports_query_info, sdb,
scratch_pool));
@@ -830,7 +841,8 @@ test_query_expectations(apr_pool_t *scra
}
static svn_error_t *
-test_query_duplicates(apr_pool_t *scratch_pool)
+test_query_duplicates(const svn_test_opts_t *opts,
+ apr_pool_t *scratch_pool)
{
sqlite3 *sdb;
int i;
@@ -839,7 +851,7 @@ test_query_duplicates(apr_pool_t *scratc
svn_boolean_t supports_query_info;
apr_hash_t *sha_to_query = apr_hash_make(scratch_pool);
- SVN_ERR(create_memory_db(&sdb, scratch_pool));
+ SVN_ERR(create_memory_db(&sdb, opts, scratch_pool));
SVN_ERR(supported_explain_query_plan(&supports_query_info, sdb,
scratch_pool));
@@ -965,12 +977,13 @@ parse_stat_data(const char *stat)
}
static svn_error_t *
-test_schema_statistics(apr_pool_t *scratch_pool)
+test_schema_statistics(const svn_test_opts_t *opts,
+ apr_pool_t *scratch_pool)
{
sqlite3 *sdb;
sqlite3_stmt *stmt;
- SVN_ERR(create_memory_db(&sdb, scratch_pool));
+ SVN_ERR(create_memory_db(&sdb, opts, scratch_pool));
SQLITE_ERR(
sqlite3_exec(sdb,
@@ -1086,12 +1099,13 @@ static void relpath_depth_sqlite(sqlite3
/* Parse all verify/check queries */
static svn_error_t *
-test_verify_parsable(apr_pool_t *scratch_pool)
+test_verify_parsable(const svn_test_opts_t *opts,
+ apr_pool_t *scratch_pool)
{
sqlite3 *sdb;
int i;
- SVN_ERR(create_memory_db(&sdb, scratch_pool));
+ SVN_ERR(create_memory_db(&sdb, opts, scratch_pool));
SQLITE_ERR(sqlite3_create_function(sdb, "relpath_depth", 1, SQLITE_ANY, NULL,
relpath_depth_sqlite, NULL, NULL));
@@ -1135,16 +1149,16 @@ static struct svn_test_descriptor_t test
SVN_TEST_NULL,
SVN_TEST_PASS2(test_sqlite_version,
"sqlite up-to-date"),
- SVN_TEST_PASS2(test_parsable,
- "queries are parsable"),
- SVN_TEST_PASS2(test_query_expectations,
- "test query expectations"),
- SVN_TEST_PASS2(test_query_duplicates,
- "test query duplicates"),
- SVN_TEST_PASS2(test_schema_statistics,
- "test schema statistics"),
- SVN_TEST_PASS2(test_verify_parsable,
- "verify queries are parsable"),
+ SVN_TEST_OPTS_PASS(test_parsable,
+ "queries are parsable"),
+ SVN_TEST_OPTS_PASS(test_query_expectations,
+ "test query expectations"),
+ SVN_TEST_OPTS_PASS(test_query_duplicates,
+ "test query duplicates"),
+ SVN_TEST_OPTS_PASS(test_schema_statistics,
+ "test schema statistics"),
+ SVN_TEST_OPTS_PASS(test_verify_parsable,
+ "verify queries are parsable"),
SVN_TEST_NULL
};