Modified: subversion/branches/authzperf/subversion/tests/libsvn_fs/fs-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_fs/fs-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_fs/fs-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_fs/fs-test.c Thu Oct 13 15:25:15 2016 @@ -3593,17 +3593,11 @@ get_file_checksum(svn_checksum_t **check apr_pool_t *pool) { svn_stream_t *stream; - svn_stream_t *checksum_stream; /* Get a stream for the file contents. */ SVN_ERR(svn_fs_file_contents(&stream, root, path, pool)); - - /* Get a checksummed stream for the contents. */ - checksum_stream = svn_stream_checksummed2(stream, checksum, NULL, - checksum_kind, TRUE, pool); - - /* Close the stream, forcing a complete read and copy the digest. */ - SVN_ERR(svn_stream_close(checksum_stream)); + SVN_ERR(svn_stream_contents_checksum(checksum, stream, checksum_kind, + pool, pool)); return SVN_NO_ERROR; }
Modified: subversion/branches/authzperf/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Thu Oct 13 15:25:15 2016 @@ -29,6 +29,7 @@ #include "../../libsvn_fs_fs/fs.h" #include "../../libsvn_fs_fs/fs_fs.h" #include "../../libsvn_fs_fs/low_level.h" +#include "../../libsvn_fs_fs/pack.h" #include "../../libsvn_fs_fs/util.h" #include "svn_hash.h" @@ -101,17 +102,16 @@ pack_notify(void *baton, #define R1_LOG_MSG "Let's serf" -/* Create a packed filesystem in DIR. Set the shard size to - SHARD_SIZE and create NUM_REVS number of revisions (in addition to - r0). Use POOL for allocations. After this function successfully - completes, the filesystem's youngest revision number will be the - same as NUM_REVS. */ -static svn_error_t * -create_packed_filesystem(const char *dir, - const svn_test_opts_t *opts, - svn_revnum_t num_revs, - int shard_size, - apr_pool_t *pool) +/* Create a filesystem in DIR. Set the shard size to SHARD_SIZE and create + NUM_REVS number of revisions (in addition to r0). Use POOL for + allocations. After this function successfully completes, the filesystem's + youngest revision number will be NUM_REVS. */ +static svn_error_t * +create_non_packed_filesystem(const char *dir, + const svn_test_opts_t *opts, + svn_revnum_t num_revs, + int shard_size, + apr_pool_t *pool) { svn_fs_t *fs; svn_fs_txn_t *txn; @@ -119,7 +119,6 @@ create_packed_filesystem(const char *dir const char *conflict; svn_revnum_t after_rev; apr_pool_t *subpool = svn_pool_create(pool); - struct pack_notify_baton pnb; apr_pool_t *iterpool; apr_hash_t *fs_config; @@ -166,6 +165,28 @@ create_packed_filesystem(const char *dir svn_pool_destroy(iterpool); svn_pool_destroy(subpool); + /* Done */ + return SVN_NO_ERROR; +} + +/* Create a packed filesystem in DIR. Set the shard size to + SHARD_SIZE and create NUM_REVS number of revisions (in addition to + r0). Use POOL for allocations. After this function successfully + completes, the filesystem's youngest revision number will be the + same as NUM_REVS. */ +static svn_error_t * +create_packed_filesystem(const char *dir, + const svn_test_opts_t *opts, + svn_revnum_t num_revs, + int shard_size, + apr_pool_t *pool) +{ + struct pack_notify_baton pnb; + + /* Create the repo and fill it. */ + SVN_ERR(create_non_packed_filesystem(dir, opts, num_revs, shard_size, + pool)); + /* Now pack the FS */ pnb.expected_shard = 0; pnb.expected_action = svn_fs_pack_notify_start; @@ -669,7 +690,7 @@ recover_fully_packed(const svn_test_opts /* ------------------------------------------------------------------------ */ /* Regression test for issue #4320 (fsfs file-hinting fails when reading a rep - from the transaction that is commiting rev = SHARD_SIZE). */ + from the transaction that is committing rev = SHARD_SIZE). */ #define REPO_NAME "test-repo-file-hint-at-shard-boundary" #define SHARD_SIZE 4 #define MAX_REV (SHARD_SIZE - 1) @@ -1740,6 +1761,56 @@ compare_0_length_rep(const svn_test_opts #undef REPO_NAME +/* ------------------------------------------------------------------------ */ +/* Verify that the format 7 pack logic works even if we can't fit all index + metadata into memory. */ +#define REPO_NAME "test-repo-pack-with-limited-memory" +#define SHARD_SIZE 4 +#define MAX_REV (2 * SHARD_SIZE - 1) +static svn_error_t * +pack_with_limited_memory(const svn_test_opts_t *opts, + apr_pool_t *pool) +{ + apr_size_t max_mem; + apr_pool_t *iterpool = svn_pool_create(pool); + + /* Bail (with success) on known-untestable scenarios */ + if (opts->server_minor_version && (opts->server_minor_version < 9)) + return svn_error_create(SVN_ERR_TEST_SKIPPED, NULL, + "pre-1.9 SVN doesn't support reordering packs"); + + /* Run with an increasing memory allowance such that we cover all + splitting scenarios. */ + for (max_mem = 350; max_mem < 8000; max_mem += max_mem / 2) + { + const char *dir; + svn_fs_t *fs; + + svn_pool_clear(iterpool); + + /* Create a filesystem. */ + dir = apr_psprintf(iterpool, "%s-%d", REPO_NAME, (int)max_mem); + SVN_ERR(create_non_packed_filesystem(dir, opts, MAX_REV, SHARD_SIZE, + iterpool)); + + /* Pack it with a narrow memory budget. */ + SVN_ERR(svn_fs_open2(&fs, dir, NULL, iterpool, iterpool)); + SVN_ERR(svn_fs_fs__pack(fs, max_mem, NULL, NULL, NULL, NULL, + iterpool)); + + /* To be sure: Verify that we didn't break the repo. */ + SVN_ERR(svn_fs_verify(dir, NULL, 0, MAX_REV, NULL, NULL, NULL, NULL, + iterpool)); + } + + svn_pool_destroy(iterpool); + + return SVN_NO_ERROR; +} +#undef REPO_NAME +#undef MAX_REV +#undef SHARD_SIZE + /* The test table. */ @@ -1790,6 +1861,8 @@ static struct svn_test_descriptor_t test "delta chains starting with PLAIN, issue #4577"), SVN_TEST_OPTS_PASS(compare_0_length_rep, "compare empty PLAIN and non-existent reps"), + SVN_TEST_OPTS_PASS(pack_with_limited_memory, + "pack with limited memory for metadata"), SVN_TEST_NULL }; Modified: subversion/branches/authzperf/subversion/tests/libsvn_subr/io-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_subr/io-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_subr/io-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_subr/io-test.c Thu Oct 13 15:25:15 2016 @@ -865,7 +865,7 @@ aligned_seek_test(apr_pool_t *pool) SVN_ERR(svn_io_file_close(f, pool)); /* now, try read data with buffering disabled. - That are a special case because APR reports a buffer size of 0. */ + That is a special case because APR reports a buffer size of 0. */ SVN_ERR(svn_io_file_open(&f, tmp_file, APR_READ, APR_OS_DEFAULT, pool)); SVN_ERR(aligned_read(f, contents, 0x1000, FALSE, pool)); SVN_ERR(aligned_read(f, contents, 0x8000, FALSE, pool)); @@ -1102,6 +1102,51 @@ test_file_rename2(apr_pool_t *pool) return SVN_NO_ERROR; } +static svn_error_t * +test_apr_trunc_workaround(apr_pool_t *pool) +{ + const char *tmp_dir; + const char *tmp_file; + apr_file_t *f; + apr_size_t len; + apr_off_t offset; + char dummy; + + /* create a temp folder & schedule it for automatic cleanup */ + SVN_ERR(svn_dirent_get_absolute(&tmp_dir, "test_apr_trunc_workaround", + pool)); + SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool)); + svn_test_add_dir_cleanup(tmp_dir); + + /* create an r/w file */ + tmp_file = svn_dirent_join(tmp_dir, "file", pool); + SVN_ERR(svn_io_file_open(&f, tmp_file, + APR_READ | APR_WRITE | APR_BUFFERED | APR_CREATE | + APR_TRUNCATE, + APR_OS_DEFAULT, pool)); + + /* write some content and put it internally into read mode */ + len = 10; + SVN_ERR(svn_io_file_write(f, "0123456789", &len, pool)); + + offset = 0; + SVN_ERR(svn_io_file_seek(f, APR_SET, &offset, pool)); + SVN_ERR(svn_io_file_getc(&dummy, f, pool)); + + /* clear the file and write some new content */ + SVN_ERR(svn_io_file_trunc(f, 0, pool)); + len = 3; + SVN_ERR(svn_io_file_write(f, "abc", &len, pool)); + + /* we should now be positioned at the end of the new content */ + offset = 0; + SVN_ERR(svn_io_file_seek(f, APR_CUR, &offset, pool)); + SVN_TEST_ASSERT(offset == (int)len); + + return SVN_NO_ERROR; +} + /* The test table. */ static int max_threads = 3; @@ -1137,6 +1182,8 @@ static struct svn_test_descriptor_t test "test svn_io_file_readline()"), SVN_TEST_PASS2(test_open_uniquely_named, "test svn_io_open_uniquely_named()"), + SVN_TEST_PASS2(test_apr_trunc_workaround, + "test workaround for APR in svn_io_file_trunc"), SVN_TEST_NULL }; Modified: subversion/branches/authzperf/subversion/tests/libsvn_subr/stream-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_subr/stream-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_subr/stream-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_subr/stream-test.c Thu Oct 13 15:25:15 2016 @@ -848,6 +848,158 @@ test_stream_compressed_read_full(apr_poo return SVN_NO_ERROR; } +static svn_error_t * +test_stream_checksum(apr_pool_t *pool) +{ + svn_string_t *str = + svn_string_create("The quick brown fox jumps over the lazy dog", pool); + svn_checksum_t *actual; + + SVN_ERR(svn_stream_contents_checksum(&actual, + svn_stream_from_string(str, pool), + svn_checksum_md5, pool, pool)); + SVN_TEST_STRING_ASSERT("9e107d9d372bb6826bd81d3542a419d6", + svn_checksum_to_cstring(actual, pool)); + + SVN_ERR(svn_stream_contents_checksum(&actual, + svn_stream_from_string(str, pool), + svn_checksum_sha1, pool, pool)); + SVN_TEST_STRING_ASSERT("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12", + svn_checksum_to_cstring(actual, pool)); + + return SVN_NO_ERROR; +} + +static svn_error_t * +test_stream_readline_file(const char *testname, + const char *eol, + apr_pool_t *pool) +{ + const char *tmp_dir; + const char *tmp_file; + svn_stream_t *stream; + svn_stringbuf_t *line; + svn_boolean_t eof; + static const char long_line[] = + "The quick brown fox jumps over the lazy dog, and " + "jackdaws love my big sphinx of quartz, and " + "pack my box with five dozen liquor jugs."; + + SVN_ERR(svn_dirent_get_absolute(&tmp_dir, testname, pool)); + SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool)); + SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool)); + svn_test_add_dir_cleanup(tmp_dir); + + /* Test 1: Read empty file. */ + tmp_file = svn_dirent_join(tmp_dir, "empty", pool); + SVN_ERR(svn_io_file_create(tmp_file, "", pool)); + SVN_ERR(svn_stream_open_readonly(&stream, tmp_file, pool, pool)); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_close(stream)); + + /* Test 2: Read empty line. */ + tmp_file = svn_dirent_join(tmp_dir, "empty-line", pool); + SVN_ERR(svn_io_file_create(tmp_file, eol, pool)); + SVN_ERR(svn_stream_open_readonly(&stream, tmp_file, pool, pool)); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(!eof); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_close(stream)); + + /* Test 3: Read two lines. */ + tmp_file = svn_dirent_join(tmp_dir, "lines", pool); + SVN_ERR(svn_io_file_create(tmp_file, + apr_pstrcat(pool, + "first", eol, "second", eol, + SVN_VA_NULL), + pool)); + SVN_ERR(svn_stream_open_readonly(&stream, tmp_file, pool, pool)); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 5); + SVN_TEST_STRING_ASSERT(line->data, "first"); + SVN_TEST_ASSERT(!eof); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 6); + SVN_TEST_STRING_ASSERT(line->data, "second"); + SVN_TEST_ASSERT(!eof); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_close(stream)); + + /* Test 4: Content without end-of-line. */ + tmp_file = svn_dirent_join(tmp_dir, "no-eol", pool); + SVN_ERR(svn_io_file_create(tmp_file, "text", pool)); + SVN_ERR(svn_stream_open_readonly(&stream, tmp_file, pool, pool)); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 4); + SVN_TEST_STRING_ASSERT(line->data, "text"); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_close(stream)); + + /* Test 5: Read long line. */ + tmp_file = svn_dirent_join(tmp_dir, "long-line", pool); + SVN_ERR(svn_io_file_create(tmp_file, + apr_pstrcat(pool, long_line, eol, SVN_VA_NULL), + pool)); + SVN_ERR(svn_stream_open_readonly(&stream, tmp_file, pool, pool)); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == strlen(long_line)); + SVN_TEST_STRING_ASSERT(line->data, long_line); + SVN_TEST_ASSERT(!eof); + + SVN_ERR(svn_stream_readline(stream, &line, eol, &eof, pool)); + SVN_TEST_ASSERT(line->len == 0); + SVN_TEST_STRING_ASSERT(line->data, ""); + SVN_TEST_ASSERT(eof); + + SVN_ERR(svn_stream_close(stream)); + + return SVN_NO_ERROR; +} + +static svn_error_t * +test_stream_readline_file_lf(apr_pool_t *pool) +{ + SVN_ERR(test_stream_readline_file("test_stream_readline_file_lf", + "\n", pool)); + return SVN_NO_ERROR; +} + +static svn_error_t * +test_stream_readline_file_crlf(apr_pool_t *pool) +{ + SVN_ERR(test_stream_readline_file("test_stream_readline_file_crlf", + "\r\n", pool)); + return SVN_NO_ERROR; +} + /* The test table. */ static int max_threads = 1; @@ -879,6 +1031,12 @@ static struct svn_test_descriptor_t test "test svn_stringbuf_from_stream"), SVN_TEST_PASS2(test_stream_compressed_read_full, "test compression for streams without partial read"), + SVN_TEST_PASS2(test_stream_checksum, + "test svn_stream_contents_checksum()"), + SVN_TEST_PASS2(test_stream_readline_file_lf, + "test reading LF-terminated lines from file"), + SVN_TEST_PASS2(test_stream_readline_file_crlf, + "test reading CRLF-terminated lines from file"), SVN_TEST_NULL }; Modified: subversion/branches/authzperf/subversion/tests/libsvn_subr/string-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_subr/string-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_subr/string-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_subr/string-test.c Thu Oct 13 15:25:15 2016 @@ -873,7 +873,7 @@ test_string_matching(apr_pool_t *pool) } static svn_error_t * -test_string_skip_prefix(apr_pool_t *pool) +test_cstring_skip_prefix(apr_pool_t *pool) { SVN_TEST_STRING_ASSERT(svn_cstring_skip_prefix("12345", "12345"), ""); @@ -986,6 +986,33 @@ test_stringbuf_leftchop(apr_pool_t *pool return SVN_NO_ERROR; } +static svn_error_t * +test_stringbuf_set(apr_pool_t *pool) +{ + svn_stringbuf_t *str = svn_stringbuf_create_empty(pool); + + SVN_TEST_STRING_ASSERT(str->data, ""); + SVN_TEST_INT_ASSERT(str->len, 0); + + svn_stringbuf_set(str, "0123456789"); + SVN_TEST_STRING_ASSERT(str->data, "0123456789"); + SVN_TEST_INT_ASSERT(str->len, 10); + + svn_stringbuf_set(str, ""); + SVN_TEST_STRING_ASSERT(str->data, ""); + SVN_TEST_INT_ASSERT(str->len, 0); + + svn_stringbuf_set(str, "0123456789abcdef"); + SVN_TEST_STRING_ASSERT(str->data, "0123456789abcdef"); + SVN_TEST_INT_ASSERT(str->len, 16); + + svn_stringbuf_set(str, "t"); + SVN_TEST_STRING_ASSERT(str->data, "t"); + SVN_TEST_INT_ASSERT(str->len, 1); + + return SVN_NO_ERROR; +} + /* ==================================================================== If you add a new test to this file, update this array. @@ -1060,12 +1087,14 @@ static struct svn_test_descriptor_t test "test string similarity scores"), SVN_TEST_PASS2(test_string_matching, "test string matching"), - SVN_TEST_PASS2(test_string_skip_prefix, + SVN_TEST_PASS2(test_cstring_skip_prefix, "test svn_cstring_skip_prefix()"), SVN_TEST_PASS2(test_stringbuf_replace_all, "test svn_stringbuf_replace_all"), SVN_TEST_PASS2(test_stringbuf_leftchop, "test svn_stringbuf_leftchop"), + SVN_TEST_PASS2(test_stringbuf_set, + "test svn_stringbuf_set()"), SVN_TEST_NULL }; Modified: subversion/branches/authzperf/subversion/tests/libsvn_wc/utils.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_wc/utils.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_wc/utils.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_wc/utils.c Thu Oct 13 15:25:15 2016 @@ -530,6 +530,9 @@ sbox_wc_update_depth(svn_test__sandbox_t APR_ARRAY_PUSH(paths, const char *) = sbox_wc_path(b, path); SVN_ERR(svn_test__create_client_ctx(&ctx, b, b->pool)); + /* Note: Tree conflict resolver tests for libsvn_client depend on this + * passing FALSE for adds_as_modifications so that tree conflicts are + * created in case of add vs add upon update. */ return svn_client_update4(&result_revs, paths, &revision, depth, sticky, FALSE, FALSE, FALSE, FALSE, ctx, b->pool); Modified: subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-queries-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-queries-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-queries-test.c Thu Oct 13 15:25:15 2016 @@ -101,6 +101,7 @@ static const int slow_statements[] = STMT_SELECT_REVERT_LIST_RECURSIVE, STMT_SELECT_DELETE_LIST, STMT_SELECT_UPDATE_MOVE_LIST, + STMT_FIND_REPOS_PATH_IN_WC, /* Designed as slow to avoid penalty on other queries */ STMT_SELECT_UNREFERENCED_PRISTINES, Modified: subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-test.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-test.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-test.c (original) +++ subversion/branches/authzperf/subversion/tests/libsvn_wc/wc-test.c Thu Oct 13 15:25:15 2016 @@ -434,6 +434,65 @@ test_legacy_commit2(const svn_test_opts_ return SVN_NO_ERROR; } +static svn_error_t * +test_internal_file_modified(const svn_test_opts_t *opts, apr_pool_t *pool) +{ + svn_test__sandbox_t b; + svn_boolean_t modified; + const char *iota_path; + apr_time_t time; + + SVN_ERR(svn_test__sandbox_create(&b, "internal_file_modified_p", + opts, pool)); + SVN_ERR(sbox_add_and_commit_greek_tree(&b)); + + iota_path = sbox_wc_path(&b, "iota"); + + /* No modification, timestamps match.*/ + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, FALSE, pool)); + SVN_TEST_ASSERT(!modified); + + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, TRUE, pool)); + SVN_TEST_ASSERT(!modified); + + /* Change timestamp on 'iota' and check. */ + SVN_ERR(svn_io_file_affected_time(&time, iota_path, pool)); + SVN_ERR(svn_io_set_file_affected_time(time + apr_time_from_sec(1), + iota_path, pool)); + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, FALSE, pool)); + SVN_TEST_ASSERT(!modified); + + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, TRUE, pool)); + SVN_TEST_ASSERT(!modified); + + /* Modify 'iota' to be different size. */ + SVN_ERR(sbox_file_write(&b, iota_path, "new iota")); + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, FALSE, pool)); + SVN_TEST_ASSERT(modified); + + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, TRUE, pool)); + SVN_TEST_ASSERT(modified); + + /* Working copy is smart and able to detect changes in files of different + * size even if timestamp didn't change. */ + SVN_ERR(svn_io_set_file_affected_time(time, iota_path, pool)); + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, FALSE, pool)); + SVN_TEST_ASSERT(modified); + + SVN_ERR(svn_wc__internal_file_modified_p(&modified, b.wc_ctx->db, + iota_path, TRUE, pool)); + SVN_TEST_ASSERT(modified); + + return SVN_NO_ERROR; +} + /* ---------------------------------------------------------------------- */ /* The list of test functions */ @@ -454,6 +513,8 @@ static struct svn_test_descriptor_t test "test legacy commit1"), SVN_TEST_OPTS_PASS(test_legacy_commit2, "test legacy commit2"), + SVN_TEST_OPTS_PASS(test_internal_file_modified, + "test internal_file_modified"), SVN_TEST_NULL }; Modified: subversion/branches/authzperf/tools/dev/fsfs-access-map.c URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/tools/dev/fsfs-access-map.c?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/tools/dev/fsfs-access-map.c (original) +++ subversion/branches/authzperf/tools/dev/fsfs-access-map.c Thu Oct 13 15:25:15 2016 @@ -34,7 +34,7 @@ typedef struct file_stats_t /* file name as found in the open() call */ const char *name; - /* file size as determined during the this tool run. Will be 0 for + /* file size as determined during the tool run. Will be 0 for * files that no longer exist. However, there may still be entries * in the read_map. */ apr_int64_t size; Modified: subversion/branches/authzperf/win-tests.py URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/win-tests.py?rev=1764707&r1=1764706&r2=1764707&view=diff ============================================================================== --- subversion/branches/authzperf/win-tests.py (original) +++ subversion/branches/authzperf/win-tests.py Thu Oct 13 15:25:15 2016 @@ -86,6 +86,7 @@ def _usage_exit(): print(" --ssl-cert : Path to SSL server certificate to trust.") print(" --https : Run Apache httpd with an https setup.") print(" --http2 : Enable http2 in Apache Httpd (>= 2.4.17).") + print(" --mod-deflate : Enable mod_deflate in Apache Httpd.") print(" --global-scheduler : Enable global scheduler.") print(" --exclusive-wc-locks : Enable exclusive working copy locks") print(" --memcached-dir=DIR : Run memcached from dir") @@ -138,7 +139,7 @@ opts, args = my_getopt(sys.argv[1:], 'hr 'disable-http-v2', 'disable-bulk-updates', 'help', 'fsfs-packing', 'fsfs-sharding=', 'javahl', 'swig=', 'list', 'enable-sasl', 'bin=', 'parallel', 'http2', - 'global-scheduler', + 'mod-deflate', 'global-scheduler', 'config-file=', 'server-minor-version=', 'log-level=', 'log-to-stdout', 'mode-filter=', 'milestone-filter=', 'ssl-cert=', 'exclusive-wc-locks', 'memcached-server=', @@ -162,6 +163,7 @@ httpd_service = None httpd_no_log = None use_ssl = False use_http2 = False +use_mod_deflate = False http_short_circuit = False advertise_httpv2 = True http_bulk_updates = True @@ -226,6 +228,8 @@ for opt, val in opts: use_ssl = 1 elif opt == '--http2': use_http2 = 1 + elif opt == '--mod-deflate': + use_mod_deflate = 1 elif opt == '--http-short-circuit': http_short_circuit = True elif opt == '--disable-http-v2': @@ -471,8 +475,8 @@ class Svnserve: class Httpd: "Run httpd for DAV tests" def __init__(self, abs_httpd_dir, abs_objdir, abs_builddir, abs_srcdir, - httpd_port, service, use_ssl, use_http2, no_log, httpv2, - short_circuit, bulk_updates): + httpd_port, service, use_ssl, use_http2, use_mod_deflate, + no_log, httpv2, short_circuit, bulk_updates): self.name = 'apache.exe' self.httpd_port = httpd_port self.httpd_dir = abs_httpd_dir @@ -574,6 +578,8 @@ class Httpd: fp.write(self._sys_module('ssl_module', 'mod_ssl.so')) if use_http2: fp.write(self._sys_module('http2_module', 'mod_http2.so')) + if use_mod_deflate: + fp.write(self._sys_module('deflate_module', 'mod_deflate.so')) fp.write(self._sys_module('dav_module', 'mod_dav.so')) if self.httpd_ver >= 2.3: fp.write(self._sys_module('access_compat_module', 'mod_access_compat.so')) @@ -610,6 +616,9 @@ class Httpd: fp.write('Protocols h2c http/1.1\n') fp.write('H2Direct on\n') + if use_mod_deflate: + fp.write('SetOutputFilter DEFLATE\n') + # Don't handle .htaccess, symlinks, etc. fp.write('<Directory />\n') fp.write('AllowOverride None\n') @@ -1019,8 +1028,8 @@ if not list_tests: if run_httpd: daemon = Httpd(abs_httpd_dir, abs_objdir, abs_builddir, abs_srcdir, httpd_port, httpd_service, use_ssl, use_http2, - httpd_no_log, advertise_httpv2, http_short_circuit, - http_bulk_updates) + use_mod_deflate, httpd_no_log, advertise_httpv2, + http_short_circuit, http_bulk_updates) if use_ssl and not ssl_cert: ssl_cert = daemon.certfile
