subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1623980 - /subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
Date Wed, 10 Sep 2014 12:32:22 GMT
Author: ivan
Date: Wed Sep 10 12:32:21 2014
New Revision: 1623980

URL: http://svn.apache.org/r1623980
Log:
On remove-log-addressing branch: Follow-up to r1623976.

* subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
  (): Include "libsvn_fs_fs/util.h"
  (fuzzing_1_byte_test): Update test to reflect branch API changes.

Modified:
    subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c

Modified: subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c?rev=1623980&r1=1623979&r2=1623980&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
(original)
+++ subversion/branches/remove-log-addressing/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
Wed Sep 10 12:32:21 2014
@@ -28,6 +28,7 @@
 #include "../../libsvn_fs_fs/fs.h"
 #include "../../libsvn_fs_fs/fs_fs.h"
 #include "../../libsvn_fs_fs/rev_file.h"
+#include "../../libsvn_fs_fs/util.h"
 
 #include "svn_hash.h"
 #include "svn_pools.h"
@@ -66,7 +67,7 @@ fuzzing_1_byte_test(const svn_test_opts_
   svn_fs_root_t *txn_root;
   svn_revnum_t rev;
   apr_hash_t *fs_config;
-  svn_fs_fs__revision_file_t *rev_file;
+  apr_file_t *file;
   apr_off_t filesize = 0;
   apr_off_t i;
 
@@ -88,9 +89,12 @@ fuzzing_1_byte_test(const svn_test_opts_
   SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(rev));
 
   /* Open the revision 1 file for modification. */
-  SVN_ERR(svn_fs_fs__open_pack_or_rev_file_writable(&rev_file, fs, rev,
-                                                    pool, iterpool));
-  SVN_ERR(svn_io_file_seek(rev_file->file, APR_END, &filesize, iterpool));
+  SVN_ERR(svn_io_file_open(&file,
+                           svn_fs_fs__path_rev_absolute(fs, rev, iterpool),
+                           APR_READ | APR_WRITE | APR_BUFFERED,
+                           APR_OS_DEFAULT, pool));
+
+  SVN_ERR(svn_io_file_seek(file, APR_END, &filesize, iterpool));
 
   /* We want all the caching we can get.  More importantly, we want to
      change the cache namespace before each test iteration. */
@@ -98,7 +102,6 @@ fuzzing_1_byte_test(const svn_test_opts_
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_DELTAS, "1");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS, "1");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, "2");
-  svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_BLOCK_READ, "0");
 
   /* Manipulate all bytes one at a time. */
   for (i = 0; i < filesize; ++i)
@@ -107,8 +110,8 @@ fuzzing_1_byte_test(const svn_test_opts_
 
       /* Read byte */
       unsigned char c_old, c_new;
-      SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &i, iterpool));
-      SVN_ERR(svn_io_file_getc((char *)&c_old, rev_file->file, iterpool));
+      SVN_ERR(svn_io_file_seek(file, APR_SET, &i, iterpool));
+      SVN_ERR(svn_io_file_getc((char *)&c_old, file, iterpool));
 
       /* What to replace it with. Skip if there is no change. */
       c_new = modifier(c_old);
@@ -116,9 +119,9 @@ fuzzing_1_byte_test(const svn_test_opts_
         continue;
 
       /* Modify / corrupt the data. */
-      SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &i, iterpool));
-      SVN_ERR(svn_io_file_putc((char)c_new, rev_file->file, iterpool));
-      SVN_ERR(svn_io_file_flush(rev_file->file, iterpool));
+      SVN_ERR(svn_io_file_seek(file, APR_SET, &i, iterpool));
+      SVN_ERR(svn_io_file_putc((char)c_new, file, iterpool));
+      SVN_ERR(svn_io_file_flush(file, iterpool));
 
       /* Make sure we use a different namespace for the caches during
          this iteration. */
@@ -143,8 +146,8 @@ fuzzing_1_byte_test(const svn_test_opts_
       svn_error_clear(err);
 
       /* Undo the corruption. */
-      SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &i, iterpool));
-      SVN_ERR(svn_io_file_putc((char)c_old, rev_file->file, iterpool));
+      SVN_ERR(svn_io_file_seek(file, APR_SET, &i, iterpool));
+      SVN_ERR(svn_io_file_putc((char)c_old, file, iterpool));
 
       svn_pool_clear(iterpool);
     }



Mime
View raw message