Modified: 
subversion/branches/inheritable-props/subversion/tests/libsvn_subr/crypto-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_subr/crypto-test.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- 
subversion/branches/inheritable-props/subversion/tests/libsvn_subr/crypto-test.c
 (original)
+++ 
subversion/branches/inheritable-props/subversion/tests/libsvn_subr/crypto-test.c
 Thu Apr 12 22:30:40 2012
@@ -104,6 +104,67 @@ test_encrypt_decrypt_password(apr_pool_t
 }
 
 
+static svn_error_t *
+test_passphrase_check(apr_pool_t *pool)
+{
+  svn_crypto__ctx_t *ctx;
+  int i;
+  apr_pool_t *iterpool;
+  const char *passwords[] = {
+    "3ncryptm!3", /* fits in one block */
+    "this is a particularly long password", /* spans blocks */
+    "mypassphrase", /* with 4-byte padding, should align on block boundary */
+  };
+  const svn_string_t *ciphertext, *iv, *salt, *secret;
+  const char *checktext;
+  svn_boolean_t is_valid;
+  int num_passwords = sizeof(passwords) / sizeof(const char *);
+
+  /* Skip this test if the crypto subsystem is unavailable. */
+  if (! svn_crypto__is_available())
+    return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, NULL);
+
+  SVN_ERR(svn_crypto__context_create(&ctx, pool));
+
+  iterpool = svn_pool_create(pool);
+  for (i = 0; i < num_passwords; i++)
+    {
+      svn_pool_clear(iterpool);
+      secret = svn_string_create(passwords[i], iterpool);
+      SVN_ERR(svn_crypto__generate_secret_checktext(&ciphertext, &iv, &salt,
+                                                    &checktext, ctx, secret,
+                                                    iterpool, iterpool));
+      SVN_ERR(svn_crypto__verify_secret(&is_valid, ctx, secret, ciphertext,
+                                        iv, salt, checktext, iterpool));
+      if (! is_valid)
+        return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
+                                "Error validating secret against checktext");
+    }
+
+  for (i = 0; i < num_passwords; i++)
+    {
+      int test_secret_index = (i + 1) % num_passwords;
+
+      svn_pool_clear(iterpool);
+      secret = svn_string_create(passwords[i], iterpool);
+      SVN_ERR(svn_crypto__generate_secret_checktext(&ciphertext, &iv, &salt,
+                                                    &checktext, ctx, secret,
+                                                    iterpool, iterpool));
+      secret = svn_string_create(passwords[test_secret_index], iterpool);
+      SVN_ERR(svn_crypto__verify_secret(&is_valid, ctx, secret, ciphertext,
+                                        iv, salt, checktext, iterpool));
+      if (is_valid)
+        return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
+                                "Expected secret validation failure; "
+                                "got success");
+    }
+
+  /* Now check that a bogus secret causes the validation to fail. */
+
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
 
 
 
@@ -114,5 +175,7 @@ struct svn_test_descriptor_t test_funcs[
     SVN_TEST_NULL,
     SVN_TEST_PASS2(test_encrypt_decrypt_password,
                    "basic password encryption/decryption test"),
+    SVN_TEST_PASS2(test_passphrase_check,
+                   "password checktext generation/validation"),
     SVN_TEST_NULL
   };

Modified: 
subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- 
subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c
 (original)
+++ 
subversion/branches/inheritable-props/subversion/tests/libsvn_wc/op-depth-test.c
 Thu Apr 12 22:30:40 2012
@@ -3169,9 +3169,7 @@ test_shadowed_update(const svn_test_opts
   SVN_ERR(wc_update(&b, "", 2));
   SVN_ERR(wc_copy(&b, "A", "A_tmp"));
   SVN_ERR(wc_update(&b, "", 1));
-  SVN_ERR(wc_move(&b, "A_tmp", "A")); /* ### XFAIL: sets moved-here on
-                                         A but A_tmp is removed and so
-                                         does not have moved-to. */
+  SVN_ERR(wc_move(&b, "A_tmp", "A"));
 
   SVN_ERR(wc_mkdir(&b, "K"));
   SVN_ERR(wc_mkdir(&b, "K/L"));
@@ -4626,7 +4624,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test_op_delete"),
     SVN_TEST_OPTS_PASS(test_child_replace_with_same_origin,
                        "test_child_replace_with_same"),
-    SVN_TEST_OPTS_XFAIL(test_shadowed_update,
+    SVN_TEST_OPTS_PASS(test_shadowed_update,
                        "test_shadowed_update"),
     SVN_TEST_OPTS_PASS(test_copy_of_deleted,
                        "test_copy_of_deleted (issue #3873)"),

Modified: subversion/branches/inheritable-props/subversion/tests/svn_test_main.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/tests/svn_test_main.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/tests/svn_test_main.c 
(original)
+++ subversion/branches/inheritable-props/subversion/tests/svn_test_main.c Thu 
Apr 12 22:30:40 2012
@@ -345,7 +345,6 @@ main(int argc, const char *argv[])
   const char *prog_name;
   int i;
   svn_boolean_t got_error = FALSE;
-  apr_allocator_t *allocator;
   apr_pool_t *pool, *test_pool;
   svn_boolean_t ran_a_test = FALSE;
   svn_boolean_t list_mode = FALSE;
@@ -368,16 +367,10 @@ main(int argc, const char *argv[])
       exit(1);
     }
 
-  /* set up the global pool.  Use a separate mutexless allocator,
-   * given this application is single threaded.
+  /* set up the global pool.  Use a separate allocator to limit memory
+   * usage but make it thread-safe to allow for multi-threaded tests.
    */
-  if (apr_allocator_create(&allocator))
-    return EXIT_FAILURE;
-
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(TRUE));
 
   /* Remember the command line */
   test_argc = argc;
@@ -461,7 +454,7 @@ main(int argc, const char *argv[])
         case server_minor_version_opt:
           {
             char *end;
-            opts.server_minor_version = strtol(opt_arg, &end, 10);
+            opts.server_minor_version = (int) strtol(opt_arg, &end, 10);
             if (end == opt_arg || *end != '\0')
               {
                 fprintf(stderr, "FAIL: Non-numeric minor version given\n");

Modified: 
subversion/branches/inheritable-props/tools/client-side/svnmucc/svnmucc.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/client-side/svnmucc/svnmucc.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/client-side/svnmucc/svnmucc.c 
(original)
+++ subversion/branches/inheritable-props/tools/client-side/svnmucc/svnmucc.c 
Thu Apr 12 22:30:40 2012
@@ -69,8 +69,6 @@ static void handle_error(svn_error_t *er
 static apr_pool_t *
 init(const char *application)
 {
-  apr_allocator_t *allocator;
-  apr_pool_t *pool;
   svn_error_t *err;
   const svn_version_checklist_t checklist[] = {
     {"svn_client", svn_client_version},
@@ -81,19 +79,14 @@ init(const char *application)
 
   SVN_VERSION_DEFINE(my_version);
 
-  if (svn_cmdline_init(application, stderr)
-      || apr_allocator_create(&allocator))
+  if (svn_cmdline_init(application, stderr))
     exit(EXIT_FAILURE);
 
   err = svn_ver_check_list(&my_version, checklist);
   if (err)
     handle_error(err, NULL);
 
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
-
-  return pool;
+  return apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
 }
 
 static svn_error_t *

Modified: 
subversion/branches/inheritable-props/tools/dev/svnraisetreeconflict/main.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/dev/svnraisetreeconflict/main.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- subversion/branches/inheritable-props/tools/dev/svnraisetreeconflict/main.c 
(original)
+++ subversion/branches/inheritable-props/tools/dev/svnraisetreeconflict/main.c 
Thu Apr 12 22:30:40 2012
@@ -316,7 +316,6 @@ check_lib_versions(void)
 int
 main(int argc, const char *argv[])
 {
-  apr_allocator_t *allocator;
   apr_pool_t *pool;
   svn_error_t *err;
   apr_getopt_t *os;
@@ -336,13 +335,7 @@ main(int argc, const char *argv[])
   /* Create our top-level pool.  Use a separate mutexless allocator,
    * given this application is single threaded.
    */
-  if (apr_allocator_create(&allocator))
-    return EXIT_FAILURE;
-
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
 
   /* Check library versions */
   err = check_lib_versions();

Modified: 
subversion/branches/inheritable-props/tools/server-side/svn-rep-sharing-stats.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/tools/server-side/svn-rep-sharing-stats.c?rev=1325561&r1=1325560&r2=1325561&view=diff
==============================================================================
--- 
subversion/branches/inheritable-props/tools/server-side/svn-rep-sharing-stats.c 
(original)
+++ 
subversion/branches/inheritable-props/tools/server-side/svn-rep-sharing-stats.c 
Thu Apr 12 22:30:40 2012
@@ -421,7 +421,6 @@ int
 main(int argc, const char *argv[])
 {
   const char *repos_path;
-  apr_allocator_t *allocator;
   apr_pool_t *pool;
   svn_boolean_t prop = FALSE, data = FALSE;
   svn_boolean_t quiet = FALSE;
@@ -446,13 +445,7 @@ main(int argc, const char *argv[])
   /* Create our top-level pool.  Use a separate mutexless allocator,
    * given this application is single threaded.
    */
-  if (apr_allocator_create(&allocator))
-    return EXIT_FAILURE;
-
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
 
   /* Check library versions */
   err = check_lib_versions();


Reply via email to