You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/01/15 22:37:28 UTC

svn commit: r1558571 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/db-test.c tests/libsvn_wc/entries-compat.c tests/libsvn_wc/utils.c tests/libsvn_wc/utils.h

Author: rhuijben
Date: Wed Jan 15 21:37:28 2014
New Revision: 1558571

URL: http://svn.apache.org/r1558571
Log:
In the C tests: When we create a wc.db file containing test data, we should
close it before running the tests on it using another db instance.

* subversion/tests/libsvn_wc/db-test.c
  (create_open): Update caller.

* subversion/tests/libsvn_wc/entries-compat.c
  (create_fake_wc): Update caller.

* subversion/tests/libsvn_wc/utils.c
  (svn_test__create_fake_wc): Remove result pool. There are no output
    arguments. Install statistics.

* subversion/tests/libsvn_wc/utils.h
  (svn_test__create_fake_wc): Update prototype.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/db-test.c
    subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.h

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1558571&r1=1558570&r2=1558571&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jan 15 21:37:28 2014
@@ -1472,6 +1472,7 @@ init_db(/* output values */
   SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_NODES));
   SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_NODES_TRIGGERS));
   SVN_ERR(svn_sqlite__exec_statements(db, STMT_CREATE_EXTERNALS));
+  SVN_ERR(svn_sqlite__exec_statements(db, STMT_INSTALL_SCHEMA_STATISTICS));
 
   /* Insert the repository. */
   SVN_ERR(create_repos_id(repos_id, repos_root_url, repos_uuid,

Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=1558571&r1=1558570&r2=1558571&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Wed Jan 15 21:37:28 2014
@@ -346,7 +346,7 @@ create_open(svn_wc__db_t **db,
   SVN_ERR(svn_io_remove_dir2(*local_abspath, TRUE, NULL, NULL, pool));
 
   SVN_ERR(svn_wc__db_open(db, NULL, FALSE, TRUE, pool, pool));
-  SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA, pool, pool));
+  SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA, pool));
 
   svn_test_add_dir_cleanup(*local_abspath);
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c?rev=1558571&r1=1558570&r2=1558571&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c Wed Jan 15 21:37:28 2014
@@ -310,10 +310,10 @@ create_fake_wc(const char *subdir, apr_p
   SVN_ERR(svn_io_remove_dir2(root, TRUE, NULL, NULL, pool));
 
   SVN_ERR(svn_dirent_get_absolute(&wc_abspath, root, pool));
-  SVN_ERR(svn_test__create_fake_wc(wc_abspath, TESTING_DATA, pool, pool));
+  SVN_ERR(svn_test__create_fake_wc(wc_abspath, TESTING_DATA, pool));
 
   wc_abspath = svn_dirent_join(wc_abspath, "M", pool);
-  SVN_ERR(svn_test__create_fake_wc(wc_abspath, M_TESTING_DATA, pool, pool));
+  SVN_ERR(svn_test__create_fake_wc(wc_abspath, M_TESTING_DATA, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1558571&r1=1558570&r2=1558571&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Wed Jan 15 21:37:28 2014
@@ -107,7 +107,6 @@ WC_QUERIES_SQL_DECLARE_STATEMENTS(statem
 svn_error_t *
 svn_test__create_fake_wc(const char *wc_abspath,
                          const char *extra_statements,
-                         apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
   const char *dotsvn_abspath = svn_dirent_join(wc_abspath, ".svn",
@@ -118,23 +117,26 @@ svn_test__create_fake_wc(const char *wc_
 
   /* Allocate MY_STATEMENTS in RESULT_POOL because the SDB will continue to
    * refer to it over its lifetime. */
-  my_statements = apr_palloc(result_pool, 6 * sizeof(const char *));
+  my_statements = apr_palloc(scratch_pool, 7 * sizeof(const char *));
   my_statements[0] = statements[STMT_CREATE_SCHEMA];
   my_statements[1] = statements[STMT_CREATE_NODES];
   my_statements[2] = statements[STMT_CREATE_NODES_TRIGGERS];
   my_statements[3] = statements[STMT_CREATE_EXTERNALS];
-  my_statements[4] = extra_statements;
-  my_statements[5] = NULL;
+  my_statements[4] = statements[STMT_INSTALL_SCHEMA_STATISTICS];
+  my_statements[5] = extra_statements;
+  my_statements[6] = NULL;
 
   /* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
   SVN_ERR(svn_io_make_dir_recursively(dotsvn_abspath, scratch_pool));
   SVN_ERR(svn_wc__db_util_open_db(&sdb, wc_abspath, "wc.db",
                                   svn_sqlite__mode_rwcreate,
                                   FALSE /* exclusive */, my_statements,
-                                  result_pool, scratch_pool));
+                                  scratch_pool, scratch_pool));
   for (i = 0; my_statements[i] != NULL; i++)
     SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
 
+  SVN_ERR(svn_sqlite__close(sdb));
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.h?rev=1558571&r1=1558570&r2=1558571&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.h Wed Jan 15 21:37:28 2014
@@ -174,7 +174,6 @@ sbox_add_and_commit_greek_tree(svn_test_
 svn_error_t *
 svn_test__create_fake_wc(const char *wc_abspath,
                          const char *extra_statements,
-                         apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);