subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1678933 - /subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
Date Tue, 12 May 2015 13:13:12 GMT
Author: ivan
Date: Tue May 12 13:13:12 2015
New Revision: 1678933

URL: http://svn.apache.org/r1678933
Log:
Follow-up to r1678927: Extend the test case with additional check.

* subversion/tests/libsvn_subr/cache-test.c
  (test_membuffer_unaligned_string_keys): Also check that we get proper
   result when providing aligned key.

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/cache-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/cache-test.c?rev=1678933&r1=1678932&r2=1678933&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/cache-test.c Tue May 12 13:13:12 2015
@@ -451,6 +451,7 @@ test_membuffer_unaligned_string_keys(apr
 
   /* Allocate explicitly to have aligned string and this add one
    * to have unaligned string.*/
+  const char *aligned_key = apr_pstrdup(pool, "fifty");
   const char *unaligned_key = apr_pstrdup(pool, "_fifty") + 1;
   const char *unaligned_prefix = apr_pstrdup(pool, "_cache:") + 1;
 
@@ -469,6 +470,17 @@ test_membuffer_unaligned_string_keys(apr
                          pool));
 
   if (! found)
+    return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
+                            "cache failed to find entry for 'fifty'");
+  if (*answer != 50)
+    return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
+                             "expected 50 but found '%ld'", *answer);
+
+  /* Make sure that we get proper result when providing aligned key*/
+  SVN_ERR(svn_cache__get((void **) &answer, &found, cache, aligned_key,
+                         pool));
+
+  if (! found)
     return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
                             "cache failed to find entry for 'fifty'");
   if (*answer != 50)



Mime
View raw message