Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/main.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/main.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/main.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/main.py Tue Feb 24 15:23:33 2015 @@ -54,7 +54,7 @@ import svntest from svntest import Failure from svntest import Skip -SVN_VER_MINOR = 9 +SVN_VER_MINOR = 10 ###################################################################### #
Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/sandbox.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/sandbox.py Tue Feb 24 15:23:33 2015 @@ -381,15 +381,18 @@ class Sandbox: raise Exception("Unexpected line '" + line + "' in proplist output" + str(out)) return props - def simple_add_symlink(self, dest, target): - """Create a symlink TARGET pointing to DEST and add it to subversion""" + def simple_symlink(self, dest, target): + """Create a symlink TARGET pointing to DEST""" if svntest.main.is_posix_os(): os.symlink(dest, self.ospath(target)) else: svntest.main.file_write(self.ospath(target), "link %s" % dest) + + def simple_add_symlink(self, dest, target, add=True): + """Create a symlink TARGET pointing to DEST and add it to subversion""" + self.simple_symlink(dest, target) self.simple_add(target) - if not svntest.main.is_posix_os(): - # '*' is evaluated on Windows + if not svntest.main.is_posix_os(): # '*' is evaluated on Windows self.simple_propset('svn:special', 'X', target) def simple_add_text(self, text, *targets): @@ -424,7 +427,7 @@ class Sandbox: def simple_append(self, dest, contents, truncate=False): """Append CONTENTS to file DEST, optionally truncating it first. DEST is a relpath relative to the WC.""" - open(self.ospath(dest), truncate and 'w' or 'a').write(contents) + open(self.ospath(dest), truncate and 'wb' or 'ab').write(contents) def simple_lock(self, *targets): """Lock TARGETS in the WC. Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/wc.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/wc.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/wc.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/svntest/wc.py Tue Feb 24 15:23:33 2015 @@ -434,7 +434,7 @@ class State: return not self.__eq__(other) @classmethod - def from_status(cls, lines): + def from_status(cls, lines, wc_dir=None): """Create a State object from 'svn status' output.""" def not_space(value): @@ -442,6 +442,17 @@ class State: return value return None + def parse_move(path, wc_dir): + if path.startswith('../'): + # ../ style paths are relative from the status root + return to_relpath(os.path.normpath(repos_join(wc_dir, path))) + else: + # Other paths are just relative from cwd + return to_relpath(path) + + if not wc_dir: + wc_dir = '' + desc = { } last = None for line in lines: @@ -455,15 +466,15 @@ class State: if ex_match: if ex_match.group('moved_from'): - path = ex_match.group('moved_from') - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('moved_from')) + last.tweak(moved_from = parse_move(path, wc_dir)) elif ex_match.group('moved_to'): - path = ex_match.group('moved_to') - last.tweak(moved_to = to_relpath(path)) + path = to_relpath(ex_match.group('moved_to')) + last.tweak(moved_to = parse_move(path, wc_dir)) elif ex_match.group('swapped_with'): - path = ex_match.group('swapped_with') - last.tweak(moved_to = to_relpath(path)) - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('swapped_with')) + last.tweak(moved_to = parse_move(path, wc_dir)) + last.tweak(moved_from = parse_move(path, wc_dir)) # Parse TC description? Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/switch_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/switch_tests.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/switch_tests.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/switch_tests.py Tue Feb 24 15:23:33 2015 @@ -2048,7 +2048,7 @@ def tolerate_local_mods(sbox): svntest.main.file_write(LM_path, 'Locally modified file.\n', 'w+') expected_output = svntest.wc.State(wc_dir, { - 'A/L' : Item(status='D '), + 'A/L' : Item(status=' ', treeconflict='C'), }) expected_disk = svntest.main.greek_state.copy() @@ -2060,6 +2060,9 @@ def tolerate_local_mods(sbox): expected_status = svntest.actions.get_virginal_state(wc_dir, 3) expected_status.tweak('', 'iota', wc_rev=1) expected_status.tweak('A', switched='S') + expected_status.add({ + 'A/L' : Item(status='A ', copied='+', treeconflict='C', wc_rev='-') + }) # Used to fail with locally modified or unversioned files svntest.actions.run_and_verify_switch(wc_dir, A_path, A2_url, @@ -2391,12 +2394,12 @@ def tree_conflicts_on_switch_2_2(sbox): expected_output = deep_trees_conflict_output expected_disk = svntest.wc.State('', { + 'DDF/D1/D2' : Item(), 'F' : Item(), 'D' : Item(), - 'DF' : Item(), - 'DD' : Item(), - 'DDF' : Item(), - 'DDD' : Item(), + 'DF/D1' : Item(), + 'DD/D1' : Item(), + 'DDD/D1/D2' : Item(), }) expected_status = svntest.deeptrees.deep_trees_virginal_state.copy() @@ -2408,20 +2411,16 @@ def tree_conflicts_on_switch_2_2(sbox): # Expect the incoming tree deletes and the local leaf deletes to mean # that all deleted paths are *really* gone, not simply scheduled for # deletion. - expected_status.tweak('F/alpha', - 'D/D1', - 'DD/D1', - 'DF/D1', - 'DDD/D1', - 'DDF/D1', + expected_status.tweak('DD/D1', 'DF/D1', 'DDF/D1', 'DDD/D1', + status='A ', copied='+', treeconflict='C', + wc_rev='-') + expected_status.tweak('DDF/D1/D2', 'DDD/D1/D2', + copied='+', wc_rev='-') + expected_status.tweak('DD/D1/D2', 'DF/D1/beta', 'DDD/D1/D2/D3', + 'DDF/D1/D2/gamma', + status='D ', copied='+', wc_rev='-') + expected_status.tweak('F/alpha', 'D/D1', status='! ', treeconflict='C', wc_rev=None) - # Remove from expected status and disk everything below the deleted paths. - expected_status.remove('DD/D1/D2', - 'DF/D1/beta', - 'DDD/D1/D2', - 'DDD/D1/D2/D3', - 'DDF/D1/D2', - 'DDF/D1/D2/gamma',) expected_info = { 'F/alpha' : { @@ -2432,13 +2431,13 @@ def tree_conflicts_on_switch_2_2(sbox): }, 'DF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DF/D1@2' + ' Source right: .none.*(/DF/D1@3)?$', }, 'DDF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DDF/D1@2' + ' Source right: .none.*(/DDF/D1@3)?$', }, @@ -2450,13 +2449,13 @@ def tree_conflicts_on_switch_2_2(sbox): }, 'DD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DD/D1@2' + ' Source right: .none.*(/DD/D1@3)?$', }, 'DDD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon switch' + '^local dir edit, incoming dir delete or move upon switch' + ' Source left: .dir.*/DDD/D1@2' + ' Source right: .none.*(/DDD/D1@3)?$', }, Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/tree_conflict_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/tree_conflict_tests.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/tree_conflict_tests.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/tree_conflict_tests.py Tue Feb 24 15:23:33 2015 @@ -1449,7 +1449,6 @@ def update_dir_with_not_present(sbox): run_and_verify_svn(None, [], 'ci', '-m', '', wc_dir) -@XFail() def update_delete_mixed_rev(sbox): "update that deletes mixed-rev" @@ -1484,6 +1483,10 @@ def update_delete_mixed_rev(sbox): status='A ', copied='+', treeconflict='C', wc_rev='-') expected_status.tweak('A/B/F', 'A/B/E', 'A/B/E/beta', 'A/B/lambda', copied='+', wc_rev='-') + + # The entries world doesn't see a changed revision as another add + # while the WC-NG world does... + expected_status.tweak('A/B/E', status='A ', entry_status=' ') run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status, None, None, None, None, None, 1, Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/update_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/update_tests.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/update_tests.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/update_tests.py Tue Feb 24 15:23:33 2015 @@ -4386,12 +4386,12 @@ def tree_conflicts_on_update_2_2(sbox): expected_output = deep_trees_conflict_output expected_disk = svntest.wc.State('', { + 'DDF/D1/D2' : Item(), 'F' : Item(), 'D' : Item(), - 'DF' : Item(), - 'DD' : Item(), - 'DDF' : Item(), - 'DDD' : Item(), + 'DF/D1' : Item(), + 'DD/D1' : Item(), + 'DDD/D1/D2' : Item(), }) expected_status = svntest.deeptrees.deep_trees_virginal_state.copy() @@ -4410,20 +4410,16 @@ def tree_conflicts_on_update_2_2(sbox): # Expect the incoming tree deletes and the local leaf deletes to mean # that all deleted paths are *really* gone, not simply scheduled for # deletion. - expected_status.tweak('F/alpha', - 'D/D1', - 'DD/D1', - 'DF/D1', - 'DDD/D1', - 'DDF/D1', - status='! ', wc_rev=None) - # Remove from expected status and disk everything below the deleted paths. - expected_status.remove('DD/D1/D2', - 'DF/D1/beta', - 'DDD/D1/D2', - 'DDD/D1/D2/D3', - 'DDF/D1/D2', - 'DDF/D1/D2/gamma',) + expected_status.tweak('DD/D1', 'DF/D1', 'DDF/D1', 'DDD/D1', + status='A ', copied='+', treeconflict='C', + wc_rev='-') + expected_status.tweak('DDF/D1/D2', 'DDD/D1/D2', + copied='+', wc_rev='-') + expected_status.tweak('DD/D1/D2', 'DF/D1/beta', 'DDD/D1/D2/D3', + 'DDF/D1/D2/gamma', + status='D ', copied='+', wc_rev='-') + expected_status.tweak('F/alpha', 'D/D1', + status='! ', treeconflict='C', wc_rev=None) expected_info = { 'F/alpha' : { @@ -4434,13 +4430,13 @@ def tree_conflicts_on_update_2_2(sbox): }, 'DF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon update' + '^local dir edit, incoming dir delete or move upon update' + ' Source left: .dir.*/DF/D1@2' + ' Source right: .none.*(/DF/D1@3)?$', }, 'DDF/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon update' + '^local dir edit, incoming dir delete or move upon update' + ' Source left: .dir.*/DDF/D1@2' + ' Source right: .none.*(/DDF/D1@3)?$', }, @@ -4452,13 +4448,13 @@ def tree_conflicts_on_update_2_2(sbox): }, 'DD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon update' + '^local dir edit, incoming dir delete or move upon update' + ' Source left: .dir.*/DD/D1@2' + ' Source right: .none.*(/DD/D1@3)?$', }, 'DDD/D1' : { 'Tree conflict' : - '^local dir delete, incoming dir delete or move upon update' + '^local dir edit, incoming dir delete or move upon update' + ' Source left: .dir.*/DDD/D1@2' + ' Source right: .none.*(/DDD/D1@3)?$', }, Modified: subversion/branches/svn-info-detail/subversion/tests/cmdline/upgrade_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/cmdline/upgrade_tests.py?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/cmdline/upgrade_tests.py (original) +++ subversion/branches/svn-info-detail/subversion/tests/cmdline/upgrade_tests.py Tue Feb 24 15:23:33 2015 @@ -935,15 +935,15 @@ def tree_replace1(sbox): { '' : Item(status=' M', wc_rev=17), 'B' : Item(status='R ', copied='+', wc_rev='-'), - 'B/f' : Item(status='R ', copied='+', wc_rev='-'), + 'B/f' : Item(status=' ', copied='+', wc_rev='-'), 'B/g' : Item(status='D ', wc_rev=17), - 'B/h' : Item(status='A ', copied='+', wc_rev='-'), - 'B/C' : Item(status='R ', copied='+', wc_rev='-'), - 'B/C/f' : Item(status='R ', copied='+', wc_rev='-'), + 'B/h' : Item(status=' ', copied='+', wc_rev='-'), + 'B/C' : Item(status=' ', copied='+', wc_rev='-'), + 'B/C/f' : Item(status=' ', copied='+', wc_rev='-'), 'B/D' : Item(status='D ', wc_rev=17), 'B/D/f' : Item(status='D ', wc_rev=17), - 'B/E' : Item(status='A ', copied='+', wc_rev='-'), - 'B/E/f' : Item(status='A ', copied='+', wc_rev='-'), + 'B/E' : Item(status=' ', copied='+', wc_rev='-'), + 'B/E/f' : Item(status=' ', copied='+', wc_rev='-'), }) run_and_verify_status_no_server(sbox.wc_dir, expected_status) @@ -961,11 +961,11 @@ def tree_replace2(sbox): 'B' : Item(status='R ', copied='+', wc_rev='-'), 'B/f' : Item(status='D ', wc_rev=12), 'B/D' : Item(status='D ', wc_rev=12), - 'B/g' : Item(status='A ', copied='+', wc_rev='-'), - 'B/E' : Item(status='A ', copied='+', wc_rev='-'), + 'B/g' : Item(status=' ', copied='+', wc_rev='-'), + 'B/E' : Item(status=' ', copied='+', wc_rev='-'), 'C' : Item(status='R ', copied='+', wc_rev='-'), - 'C/f' : Item(status='A ', copied='+', wc_rev='-'), - 'C/D' : Item(status='A ', copied='+', wc_rev='-'), + 'C/f' : Item(status=' ', copied='+', wc_rev='-'), + 'C/D' : Item(status=' ', copied='+', wc_rev='-'), 'C/g' : Item(status='D ', wc_rev=12), 'C/E' : Item(status='D ', wc_rev=12), }) Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_client/client-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_client/client-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_client/client-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_client/client-test.c Tue Feb 24 15:23:33 2015 @@ -1157,7 +1157,7 @@ test_copy_pin_externals(const svn_test_o APR_ARRAY_PUSH(copy_sources, svn_client_copy_source_t *) = ©_source; A_copy_url = apr_pstrcat(pool, repos_url, "/A_copy", SVN_VA_NULL); SVN_ERR(svn_client_copy7(copy_sources, A_copy_url, FALSE, FALSE, - FALSE, TRUE, externals_to_pin, + FALSE, FALSE, TRUE, externals_to_pin, NULL, NULL, NULL, ctx, pool)); /* Verify that externals were pinned as expected. */ Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_client/mtcc-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_client/mtcc-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_client/mtcc-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_client/mtcc-test.c Tue Feb 24 15:23:33 2015 @@ -472,8 +472,55 @@ struct handle_rev_baton svn_revnum_t last; svn_boolean_t up; svn_boolean_t first; + + /* Per revision handler */ + svn_txdelta_window_handler_t inner_handler; + void *inner_baton; + + /* Swapped between revisions to reconstruct data */ + svn_stringbuf_t *cur; + svn_stringbuf_t *prev; + + /* Pool for some test stuff */ + apr_pool_t *pool; }; +/* Implement svn_txdelta_window_handler_t */ +static svn_error_t * +handle_rev_delta(svn_txdelta_window_t *window, + void * baton) +{ + struct handle_rev_baton *hrb = baton; + + SVN_ERR(hrb->inner_handler(window, hrb->inner_baton)); + + if (!window) + { + int expected_rev; + const char *expected; + + /* Some revisions don't update the revision body */ + switch (hrb->last) + { + case 5: + expected_rev = 4; + break; + case 7: /* Not reported */ + case 8: + expected_rev = 6; + break; + default: + expected_rev = (int)hrb->last; + } + + expected = apr_psprintf(hrb->pool, "revision-%d", expected_rev); + + SVN_TEST_STRING_ASSERT(hrb->cur->data, expected); + } + + return SVN_NO_ERROR; +} + /* Helper for test_file_revs_both_ways */ static svn_error_t * handle_rev(void *baton, @@ -489,19 +536,38 @@ handle_rev(void *baton, struct handle_rev_baton *hrb = baton; svn_revnum_t expected_rev = hrb->up ? (hrb->last + 1) : (hrb->last - 1); + if (expected_rev == 7) + expected_rev = hrb->up ? 8 : 6; + SVN_TEST_ASSERT(rev == expected_rev); SVN_TEST_ASSERT(apr_hash_count(rev_props) >= 3); SVN_TEST_STRING_ASSERT(path, (rev < 5) ? "/iota" : "/mu"); - if (!hrb->first && rev == (hrb->up ? 5 : 4)) + if (!hrb->first + && (rev == (hrb->up ? 5 : 4) || rev == (hrb->up ? 8 : 6))) SVN_TEST_ASSERT(delta_handler == NULL); else SVN_TEST_ASSERT(delta_handler != NULL); if (delta_handler) { - *delta_handler = svn_delta_noop_window_handler; - *delta_baton = NULL; + svn_stringbuf_t *tmp; + + *delta_handler = handle_rev_delta; + *delta_baton = hrb; + + /* Swap string buffers, to use previous as original */ + tmp = hrb->prev; + hrb->prev = hrb->cur; + hrb->cur = tmp; + + svn_stringbuf_setempty(hrb->cur); + + svn_txdelta_apply(svn_stream_from_stringbuf(hrb->prev, pool), + svn_stream_from_stringbuf(hrb->cur, pool), + NULL, NULL, pool, + &hrb->inner_handler, + &hrb->inner_baton); } hrb->last = rev; @@ -579,10 +645,16 @@ test_file_revs_both_ways(const svn_test_ SVN_ERR(svn_client_open_ra_session2(&ra, repos_url, NULL, ctx, pool, subpool)); + hrb.prev = svn_stringbuf_create("", pool); + hrb.cur = svn_stringbuf_create("", pool); + hrb.pool = pool; + svn_pool_clear(subpool); hrb.up = FALSE; hrb.last = 5; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "iota", 4, 1, FALSE, handle_rev, &hrb, subpool)); @@ -592,6 +664,8 @@ test_file_revs_both_ways(const svn_test_ hrb.up = TRUE; hrb.last = 0; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "iota", 1, 4, FALSE, handle_rev, &hrb, subpool)); @@ -601,6 +675,8 @@ test_file_revs_both_ways(const svn_test_ hrb.up = FALSE; hrb.last = 7; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 6, 1, FALSE, handle_rev, &hrb, subpool)); @@ -610,11 +686,41 @@ test_file_revs_both_ways(const svn_test_ hrb.up = TRUE; hrb.last = 0; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 1, 6, FALSE, handle_rev, &hrb, subpool)); SVN_TEST_ASSERT(hrb.last == 6); + /* Ressurect mu */ + svn_pool_clear(subpool); + SVN_ERR(svn_client__mtcc_create(&mtcc, repos_url, 7, ctx, subpool, subpool)); + SVN_ERR(svn_client__mtcc_add_copy("mu", 6, "mu", mtcc, subpool)); + SVN_ERR(verify_mtcc_commit(mtcc, 8, subpool)); + + svn_pool_clear(subpool); + hrb.up = TRUE; + hrb.last = 0; + hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); + SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 1, SVN_INVALID_REVNUM, FALSE, + handle_rev, &hrb, + subpool)); + SVN_TEST_ASSERT(hrb.last == 8); + + svn_pool_clear(subpool); + hrb.up = FALSE; + hrb.last = 9; + hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); + SVN_ERR(svn_ra_get_file_revs2(ra, "mu", SVN_INVALID_REVNUM, 1, FALSE, + handle_rev, &hrb, + subpool)); + SVN_TEST_ASSERT(hrb.last == 1); + return SVN_NO_ERROR; } Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/cache-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/cache-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/cache-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/cache-test.c Tue Feb 24 15:23:33 2015 @@ -354,6 +354,74 @@ test_memcache_long_key(const svn_test_op return SVN_NO_ERROR; } +static svn_error_t * +test_membuffer_cache_clearing(apr_pool_t *pool) +{ + svn_cache__t *cache; + svn_membuffer_t *membuffer; + svn_boolean_t found; + svn_revnum_t *value; + svn_revnum_t valueA = 12345; + svn_revnum_t valueB = 67890; + + /* Create a simple cache for strings, keyed by strings. */ + SVN_ERR(svn_cache__membuffer_cache_create(&membuffer, 10*1024, 1, 0, + TRUE, TRUE, pool)); + SVN_ERR(svn_cache__create_membuffer_cache(&cache, + membuffer, + serialize_revnum, + deserialize_revnum, + APR_HASH_KEY_STRING, + "cache:", + SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + FALSE, + pool, pool)); + + /* Initially, the cache is empty. */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* Add entries. */ + SVN_ERR(svn_cache__set(cache, "key A", &valueA, pool)); + SVN_ERR(svn_cache__set(cache, "key B", &valueB, pool)); + + /* Added entries should be cached (too small to get evicted already). */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(found); + SVN_TEST_ASSERT(*value == valueA); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(found); + SVN_TEST_ASSERT(*value == valueB); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* Clear the cache. */ + SVN_ERR(svn_cache__membuffer_clear(membuffer)); + + /* The cache is empty again. */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* But still functional: */ + SVN_ERR(svn_cache__set(cache, "key B", &valueB, pool)); + SVN_ERR(svn_cache__has_key(&found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__has_key(&found, cache, "key B", pool)); + SVN_TEST_ASSERT(found); + SVN_ERR(svn_cache__has_key(&found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + return SVN_NO_ERROR; +} + /* The test table. */ @@ -372,6 +440,8 @@ static struct svn_test_descriptor_t test "basic membuffer svn_cache test"), SVN_TEST_PASS2(test_membuffer_serializer_error_handling, "test for error handling in membuffer svn_cache"), + SVN_TEST_PASS2(test_membuffer_cache_clearing, + "test clearing a membuffer svn_cache"), SVN_TEST_NULL }; Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/sqlite-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/sqlite-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/sqlite-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/sqlite-test.c Tue Feb 24 15:23:33 2015 @@ -49,7 +49,7 @@ static svn_error_t * error_second(svn_sqlite__context_t *sctx, int argc, svn_sqlite__value_t *values[], - apr_pool_t *scratch_pool) + void *baton) { static int i = 0; Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/subst_translate-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/subst_translate-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_subr/subst_translate-test.c Tue Feb 24 15:23:33 2015 @@ -115,7 +115,7 @@ test_svn_subst_translate_string2_null_en svn_string_t *new_value = NULL; svn_boolean_t translated_to_utf8 = FALSE; svn_boolean_t translated_line_endings = TRUE; - /* 'Æ', which is 0xc6 in both ISO-8859-1 and Windows-1252 */ + /* The 'AE' ligature, which is 0xc6 in both ISO-8859-1 and Windows-1252 */ svn_string_t *source_string = svn_string_create("\xc6", pool); SVN_ERR(svn_subst_translate_string2(&new_value, &translated_to_utf8, Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/db-test.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/db-test.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/db-test.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/db-test.c Tue Feb 24 15:23:33 2015 @@ -88,248 +88,205 @@ static const char * const TESTING_DATA = "insert into wcroot values (1, null); " "insert into pristine values ('$sha1$" SHA1_1 "', NULL, 15, 1, '$md5 $" MD5_1 "'); " +); - /* ### The file_externals column in NODES is temporary, and will be - ### removed. However, to keep the tests passing, we need to add it - ### to the following insert statements. *Be sure to remove it*. */ +#define NOT_MOVED FALSE, NULL +#define NO_COPY_FROM 0, NULL, SVN_INVALID_REVNUM +static const svn_test__nodes_data_t nodes_init_data[] = { /* load the base nodes into the nodes table */ - "insert into nodes values (" - " 1, '', 0, null, 1, '', 1, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'A', 0, '', 1, 'A', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'B', 0, '', 1, 'B', null, 'excluded'," - " null, null, 'symlink', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'C', 0, '', 1, 'C', null, 'server-excluded'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'D', 0, '', 1, 'D', null, 'not-present'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'E', 0, '', 1, 'E', null, 'incomplete'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'F', 0, '', 1, 'F', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'G', 0, '', 2, 'G-alt', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'H', 0, '', 1, 'H', 1, 'normal'," - " null, null, 'symlink', '()', null, null, 'H-target', 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'I', 0, '', 1, 'I', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J', 0, '', 1, 'J', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e', 0, 'J', 1, 'J/J-e', 1, 'normal'," - " null, 'other/place', 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-a', 0, 'J/J-e', 1, 'J/J-e/J-e-a', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b', 0, 'J/J-e', 1, 'J/J-e/J-e-b', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b/Jeba', 0, 'J/J-e/J-e-b', 1, 'J/J-e/J-e-b/Jeba', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f', 0, 'J', 1, 'J/J-f', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f/J-f-a', 0, 'J/J-f', 1, 'J/J-f/J-f-a', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K', 0, '', 1, 'K', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-a', 0, 'K', 1, 'K/K-a', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-b', 0, 'K', 1, 'K/K-b', 1, 'normal'," - " null, 'moved/away', 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "" - /* Load data into NODES table; - ### op_depths have not been calculated by me yet; - the value 1 is just 'good enough' to make the nodes WORKING nodes. */ - "insert into nodes values (" - " 1, 'I', 1, '', 2, 'some/dir', 2, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - - /* I'm not sure what the working J is supposed to represent. It - replaces the base J, but is it a copy or not? It has no - copyfrom, but nodes like J/J-e appear to be deleted which - implies they are children of a copied J. */ - "insert into nodes values (" - " 1, 'J', 1, '', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-a', 1, 'J', null, null, null, 'normal'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b', 2, 'J', 2, 'some/dir', 2, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b/J-b-a', 3, 'J/J-b', 2, 'another/dir', 2, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b/J-b-b', 2, 'J/J-b', null, null, 2, 'normal'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c', 1, 'J', null, null, null, 'normal'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c/J-c-a', 1, 'J/J-c', null, null, null, 'normal'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c', 2, 'J', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c/J-c-a', 2, 'J/J-c', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-d', 2, 'J', 2, 'moved/file', 2, 'normal'," - " 1, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'moved/file', 0, 'moved', 2, 'moved/file', 2, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'moved/file', 2, 'moved', 2, 'moved/file', 2, 'base-deleted'," - " null, 'J/J-d', 'file', '()', null, null, null, null, null, null," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e', 1, 'J', null, null, null, 'normal'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-a', 1, 'J/J-e', null, null, null, 'normal'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b', 1, 'J/J-e', null, null, null, 'normal'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e', 2, 'J', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-a', 2, 'J/J-e', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b', 2, 'J/J-e', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b/Jeba', 1, 'J/J-e/J-e-b', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f', 1, 'J', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f/J-f-a', 1, 'J/J-f', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K', 1, '', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-a', 1, 'K', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-b', 1, 'K', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L', 1, '', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a', 1, 'L', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a/L-a-a', 1, 'L/L-a', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a', 2, 'L', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a/L-a-a', 2, 'L/L-a', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'other/place', 2, 'other', null, null, null, 'normal'," - " 1, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'other/place/J-e-a', 2, 'other/place', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'other/place/J-e-b', 2, 'other/place', null, null, null, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'other/place/J-e-b/Jeba', 0, 'other/place/J-e-b', null, null, null, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into actual_node values (" - " 1, 'I', '', null, null, null, null, null, 'changelist', null, " - " null, null, null, null, null);" - "insert into actual_node values (" - " 1, 'F', '', null, null, null, null, null, null, null, " - " '" F_TC_DATA "', null, null, null, null);" - "insert into actual_node values (" - " 1, 'G', '', null, null, null, null, null, null, null, " - " '" G_TC_DATA "', null, null, null, null);" - ); + { 0, "", "normal", 1, "", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + { 0, "A", "normal", 1, "A", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1, + FALSE, NULL, 10, 10 }, + + { 0, "B", "excluded", 1, "B", SVN_INVALID_REVNUM, NOT_MOVED, + svn_node_symlink}, + + { 0, "C", "server-excluded", 1, "C", 0, NOT_MOVED, + svn_node_unknown}, + + { 0, "D", "not-present", 1, "D", 0, NOT_MOVED, + svn_node_unknown}, + + { 0, "E", "incomplete", 1, "E", 1, NOT_MOVED, + svn_node_unknown}, + + { 0, "F", "normal", 1, "F", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2}, + + { 0, "G", "normal", 2, "G-alt", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 0, "H", "normal", 1, "H", 1, NOT_MOVED, + svn_node_symlink, "()", NULL, NULL, "H-target", 1, TIME_1a, AUTHOR_1 }, + + { 0, "I", "normal", 1, "I", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J", "normal", 1, "J", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-e", "normal", 1, "J/J-e", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-e/J-e-a", "normal", 1, "J/J-e/J-e-a", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-e/J-e-b", "normal", 1, "J/J-e/J-e-b", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-e/J-e-b/Jeba", "normal", 1, "J/J-e/J-e-b/Jeba", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-f", "normal", 1, "J/J-f", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J/J-f/J-f-a", "normal", 1, "J/J-f/J-f-a", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "J", "normal", 1, "J", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "K", "normal", 1, "K", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "K/K-a", "normal", 2, "K/K-a", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2, + FALSE, NULL, 15, 14}, + + { 0, "K/K-b", "normal", 2, "K/K-b", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2, + FALSE, NULL, 15, 14}, + + /* Load data into the working layers of NODES */ + + { 1, "I", "normal", 2, "some/dir", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + /* J was originally a local addition, but its descendants are replaced, + so let's turn J in a copy */ + { 1, "J", "normal", 2, "q", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-a", "normal", 2, "q/J-a", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-b", "normal", 2, "q/J-b", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 3, "J/J-b/J-b-a", "normal", 2, "another/dir", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-b/J-b-b", "normal", 2, "q/J-b/J-b-b", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-c", "normal", 2, "q/J-c", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-c/J-c-a", "normal", 2, "q/J-c/J-c-a", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "J/J-c", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 2, "J/J-c/J-c-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 2, "J/J-d", "normal", 2, "moved/file", 2, TRUE, NULL, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 0, "moved", "normal", 2, "moved", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1 }, + + { 0, "moved/file", "normal", 2, "moved/file", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "moved/file", "base-deleted", NO_COPY_FROM, FALSE, "J/J-d", + svn_node_file}, + + { 1, "J/J-e", "normal", 2, "q/J-e", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-e/J-e-a", "normal", 2, "q/J-e/J-e-a", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-e/J-e-b", "normal", 2, "q/J-e/J-e-b", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "J/J-e", "base-deleted", NO_COPY_FROM, FALSE, "other/place", + svn_node_dir}, + + { 2, "J/J-e/J-e-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 2, "J/J-e/J-e-b", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "J/J-e/J-e-b/Jeba", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 1, "J/J-f", "normal", 2, "q/J-f", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "J/J-f/J-f-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "K", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "K/K-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 1, "K/K-b", "base-deleted", NO_COPY_FROM, FALSE, "moved/away", + svn_node_file}, + + { 1, "L", "normal", 2, "from", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "L/L-a", "normal", 2, "from/L-a", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 1, "L/L-a/L-a-a", "normal", 2, "from/L-a/L-a-a", 2, NOT_MOVED, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "L/L-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 2, "L/L-a/L-a-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 0, "other", "normal", 2, "other", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "other/place", "normal", 2, "q/J-e", 2, TRUE, NULL, + svn_node_dir, "()", "immediates", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "other/place/J-e-a", "normal", 2, "q/J-e/J-e-a", 2, TRUE, NULL, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "other/place/J-e-b", "normal", 2, "q/J-e/J-e-b", 2, TRUE, NULL, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2 }, + + { 2, "other/place/J-e-b/Jeba", "normal", 2, "q/J-e/J-e-b/Jeba", 2, TRUE, NULL, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1 }, + + /*** NEW ****/ + { 2, "moved/away", "normal", 2, "K/K-b", 1, TRUE, NULL, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2, + FALSE, NULL, 15, 14}, + { 0 } +}; + +static const svn_test__actual_data_t actual_init_data[] = { + { "A", NULL, "changelist", NULL }, + { "F", NULL, NULL, F_TC_DATA }, + { "G", NULL, NULL, F_TC_DATA }, + + { 0 } +}; static svn_error_t * create_open(svn_wc__db_t **db, @@ -346,7 +303,8 @@ 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)); + SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA, + nodes_init_data, actual_init_data, pool)); svn_test_add_dir_cleanup(*local_abspath); @@ -366,18 +324,17 @@ set_prop(apr_hash_t *props, const char * } -static svn_boolean_t +static svn_error_t * validate_abspath(const char *wcroot_abspath, const char *expected_relpath, const char *actual_abspath, apr_pool_t *scratch_pool) { - if (actual_abspath == NULL) - return FALSE; - return strcmp(svn_dirent_join(wcroot_abspath, + SVN_TEST_STRING_ASSERT(actual_abspath, + svn_dirent_join(wcroot_abspath, expected_relpath, - scratch_pool), - actual_abspath) == 0; + scratch_pool)); + return SVN_NO_ERROR; } @@ -776,11 +733,17 @@ test_children(apr_pool_t *pool) SVN_ERR(svn_wc__db_base_get_children(&children, db, local_abspath, pool, pool)); - SVN_TEST_ASSERT(children->nelts == 11); + SVN_TEST_ASSERT(children->nelts == 13); for (i = children->nelts; i--; ) { const char *name = APR_ARRAY_IDX(children, i, const char *); + if (strcmp(name, "moved") == 0 + || strcmp(name, "other") == 0) + { + continue; + } + SVN_TEST_ASSERT(strlen(name) == 1); /* ### check the actual values */ } @@ -788,11 +751,17 @@ test_children(apr_pool_t *pool) SVN_ERR(svn_wc__db_read_children(&children, db, local_abspath, pool, pool)); - SVN_TEST_ASSERT(children->nelts == 12); + SVN_TEST_ASSERT(children->nelts == 14); for (i = children->nelts; i--; ) { const char *name = APR_ARRAY_IDX(children, i, const char *); + if (strcmp(name, "moved") == 0 + || strcmp(name, "other") == 0) + { + continue; + } + SVN_TEST_ASSERT(strlen(name) == 1); /* ### check the actual values */ } @@ -863,7 +832,7 @@ test_working_info(apr_pool_t *pool) SVN_TEST_ASSERT(checksum == NULL); SVN_TEST_ASSERT(recorded_size == SVN_INVALID_FILESIZE); SVN_TEST_ASSERT(target == NULL); - SVN_TEST_STRING_ASSERT(changelist, "changelist"); + SVN_TEST_STRING_ASSERT(changelist, NULL); SVN_TEST_STRING_ASSERT(original_repos_relpath, "some/dir"); SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO); SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO); @@ -881,8 +850,31 @@ test_working_info(apr_pool_t *pool) /* ### we need a hojillion more tests in here. I just want to get this ### round checked in, so I'm skipping more tests at this point. */ - - + SVN_ERR(svn_wc__db_read_info( + &status, &kind, &revision, + &repos_relpath, &repos_root_url, &repos_uuid, + &changed_rev, &changed_date, &changed_author, + &depth, &checksum, &target, &original_repos_relpath, + &original_root_url, &original_uuid, &original_revnum, + &lock, &recorded_size, &recorded_time, &changelist, + &conflicted, &op_root, &had_props, &props_mod, + &have_base, &have_more_work, &have_work, + db, svn_dirent_join(local_abspath, "A", pool), + pool, pool)); + SVN_TEST_ASSERT(status == svn_wc__db_status_normal); + SVN_TEST_ASSERT(kind == svn_node_file); + SVN_TEST_STRING_ASSERT(changelist, "changelist"); + SVN_TEST_ASSERT(revision == 1); + SVN_TEST_STRING_ASSERT(repos_relpath, "A"); + SVN_TEST_STRING_ASSERT(repos_root_url, "http://example.com/one"); + SVN_TEST_STRING_ASSERT(repos_uuid, "uuid1"); + SVN_TEST_ASSERT(changed_rev == 1); + SVN_TEST_ASSERT(changed_date == TIME_1a); + SVN_TEST_STRING_ASSERT(changed_author, AUTHOR_1); + SVN_TEST_ASSERT(depth == svn_depth_unknown); + SVN_TEST_ASSERT(checksum != NULL); + SVN_TEST_ASSERT(recorded_size == 10); + SVN_TEST_ASSERT(target == NULL); return SVN_NO_ERROR; } @@ -906,9 +898,16 @@ test_pdh(apr_pool_t *pool) NULL, NULL, pool)); + SVN_ERR(svn_wc__db_base_add_directory( + db, svn_dirent_join(local_abspath, "sub2", pool), + local_abspath, "sub2", ROOT_ONE, UUID_ONE, 1, + apr_hash_make(pool), 1, 1, "me", NULL, + svn_depth_infinity, NULL, FALSE, NULL, NULL, + NULL, NULL, pool)); + SVN_ERR(svn_wc__db_base_add_excluded_node( - db, svn_dirent_join(local_abspath, "sub/A", pool), - "sub/A", ROOT_ONE, UUID_ONE, 1, + db, svn_dirent_join(local_abspath, "sub2/A", pool), + "sub2/A", ROOT_ONE, UUID_ONE, 1, svn_node_file, svn_wc__db_status_server_excluded, NULL, NULL, pool)); @@ -946,17 +945,17 @@ test_scan_addition(apr_pool_t *pool) &original_revision, db, svn_dirent_join(local_abspath, "J", pool), pool, pool)); - SVN_TEST_ASSERT(status == svn_wc__db_status_added); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", op_root_abspath, pool)); + SVN_TEST_ASSERT(status == svn_wc__db_status_copied); + SVN_ERR(validate_abspath(local_abspath, "J", op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE); - SVN_TEST_ASSERT(original_repos_relpath == NULL); - SVN_TEST_ASSERT(original_root_url == NULL); - SVN_TEST_ASSERT(original_uuid == NULL); - SVN_TEST_ASSERT(original_revision == SVN_INVALID_REVNUM); + SVN_TEST_STRING_ASSERT(original_repos_relpath, "q"); + SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO); + SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO); + SVN_TEST_ASSERT(original_revision == 2); - /* Simple addition of a file (affects how scan-up is started). */ + /* Simple copy (affects how scan-up is started). */ SVN_ERR(svn_wc__db_scan_addition( &status, &op_root_abspath, &repos_relpath, &repos_root_url, &repos_uuid, @@ -964,15 +963,15 @@ test_scan_addition(apr_pool_t *pool) &original_revision, db, svn_dirent_join(local_abspath, "J/J-a", pool), pool, pool)); - SVN_TEST_ASSERT(status == svn_wc__db_status_added); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", op_root_abspath, pool)); + SVN_TEST_ASSERT(status == svn_wc__db_status_copied); + SVN_ERR(validate_abspath(local_abspath, "J", op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-a"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE); - SVN_TEST_ASSERT(original_repos_relpath == NULL); - SVN_TEST_ASSERT(original_root_url == NULL); - SVN_TEST_ASSERT(original_uuid == NULL); - SVN_TEST_ASSERT(original_revision == SVN_INVALID_REVNUM); + SVN_TEST_STRING_ASSERT(original_repos_relpath, "q"); + SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO); + SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO); + SVN_TEST_ASSERT(original_revision == 2); /* Node was moved here. */ SVN_ERR(svn_wc__db_scan_addition( @@ -990,15 +989,15 @@ test_scan_addition(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-d", pool), pool, pool)); SVN_TEST_ASSERT(status == svn_wc__db_status_moved_here); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-d", + SVN_ERR(validate_abspath(local_abspath, "J/J-d", op_root_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file", + SVN_ERR(validate_abspath(local_abspath, "moved/file", moved_from_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-d", + SVN_ERR(validate_abspath(local_abspath, "J/J-d", move_op_root_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file", + SVN_ERR(validate_abspath(local_abspath, "moved/file", move_op_root_src, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file", + SVN_ERR(validate_abspath(local_abspath, "moved/file", delete_op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-d"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); @@ -1017,12 +1016,12 @@ test_scan_addition(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-b", pool), pool, pool)); SVN_TEST_ASSERT(status == svn_wc__db_status_copied); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-b", + SVN_ERR(validate_abspath(local_abspath, "J", op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-b"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE); - SVN_TEST_STRING_ASSERT(original_repos_relpath, "some/dir"); + SVN_TEST_STRING_ASSERT(original_repos_relpath, "q"); SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO); SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO); SVN_TEST_ASSERT(original_revision == 2); @@ -1036,7 +1035,7 @@ test_scan_addition(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-b/J-b-a", pool), pool, pool)); SVN_TEST_ASSERT(status == svn_wc__db_status_copied); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-b/J-b-a", + SVN_ERR(validate_abspath(local_abspath, "J/J-b/J-b-a", op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-b/J-b-a"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); @@ -1055,12 +1054,12 @@ test_scan_addition(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-b/J-b-b", pool), pool, pool)); SVN_TEST_ASSERT(status == svn_wc__db_status_copied); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-b", + SVN_ERR(validate_abspath(local_abspath, "J", op_root_abspath, pool)); SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-b/J-b-b"); SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE); SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE); - SVN_TEST_STRING_ASSERT(original_repos_relpath, "some/dir"); + SVN_TEST_STRING_ASSERT(original_repos_relpath, "q"); SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO); SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO); SVN_TEST_ASSERT(original_revision == 2); @@ -1089,13 +1088,13 @@ test_scan_deletion(apr_pool_t *pool) ©_op_root_abspath, db, svn_dirent_join(local_abspath, "J/J-e", pool), pool, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place", + SVN_ERR(validate_abspath(local_abspath, "other/place", moved_to_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e", + SVN_ERR(validate_abspath(local_abspath, "J/J-e", work_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place", + SVN_ERR(validate_abspath(local_abspath, "other/place", copy_op_root_abspath, pool)); /* Node was moved elsewhere (child of operation root). */ @@ -1106,13 +1105,13 @@ test_scan_deletion(apr_pool_t *pool) ©_op_root_abspath, db, svn_dirent_join(local_abspath, "J/J-e/J-e-a", pool), pool, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place/J-e-a", + SVN_ERR(validate_abspath(local_abspath, "other/place/J-e-a", moved_to_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e", + SVN_ERR(validate_abspath(local_abspath, "J/J-e", work_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place", + SVN_ERR(validate_abspath(local_abspath, "other/place", copy_op_root_abspath, pool)); /* Root of delete. Parent is a WORKING node. */ @@ -1124,10 +1123,10 @@ test_scan_deletion(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-c", pool), pool, pool)); /* Implicit delete of "J" (via replacement). */ - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-c", + SVN_ERR(validate_abspath(local_abspath, "J/J-c", work_del_abspath, pool)); /* Child of a deleted root. */ @@ -1139,10 +1138,10 @@ test_scan_deletion(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-c/J-c-a", pool), pool, pool)); /* Implicit delete of "J" (via replacement). */ - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-c", + SVN_ERR(validate_abspath(local_abspath, "J/J-c", work_del_abspath, pool)); /* Base-deleted tree extending past deleted WORKING subtree. */ @@ -1156,11 +1155,11 @@ test_scan_deletion(apr_pool_t *pool) /* ### I don't understand this. "J/J-e/J-e-b/Jeba" is a deleted base node that is not overlayed by the replacement rooted at "J". Why does base_del_abspath refer to "J-e"? */ - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place/J-e-b/Jeba", + SVN_ERR(validate_abspath(local_abspath, "other/place/J-e-b/Jeba", moved_to_abspath, pool)); - SVN_TEST_ASSERT(work_del_abspath == NULL); + SVN_TEST_STRING_ASSERT(work_del_abspath, NULL); /* Base-deleted tree extending past added WORKING tree. */ SVN_ERR(svn_wc__db_scan_deletion( @@ -1171,10 +1170,10 @@ test_scan_deletion(apr_pool_t *pool) db, svn_dirent_join(local_abspath, "J/J-f/J-f-a", pool), pool, pool)); /* Implicit delete of "J" (via replacement). */ - SVN_TEST_ASSERT(validate_abspath(local_abspath, "J", + SVN_ERR(validate_abspath(local_abspath, "J", base_del_abspath, pool)); - SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(work_del_abspath == NULL); + SVN_TEST_STRING_ASSERT(moved_to_abspath, NULL); + SVN_TEST_STRING_ASSERT(work_del_abspath, NULL); /* Root of delete. Parent is a BASE node. */ SVN_ERR(svn_wc__db_scan_deletion( @@ -1184,10 +1183,10 @@ test_scan_deletion(apr_pool_t *pool) NULL, db, svn_dirent_join(local_abspath, "K", pool), pool, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "K", + SVN_ERR(validate_abspath(local_abspath, "K", base_del_abspath, pool)); - SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(work_del_abspath == NULL); + SVN_TEST_STRING_ASSERT(moved_to_abspath, NULL); + SVN_TEST_STRING_ASSERT(work_del_abspath, NULL); /* Base-deleted tree. Start below root. */ SVN_ERR(svn_wc__db_scan_deletion( @@ -1197,10 +1196,10 @@ test_scan_deletion(apr_pool_t *pool) NULL, db, svn_dirent_join(local_abspath, "K/K-a", pool), pool, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "K", + SVN_ERR(validate_abspath(local_abspath, "K", base_del_abspath, pool)); - SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(work_del_abspath == NULL); + SVN_TEST_STRING_ASSERT(moved_to_abspath, NULL); + SVN_TEST_STRING_ASSERT(work_del_abspath, NULL); /* Base-deleted tree via move. */ SVN_ERR(svn_wc__db_scan_deletion( @@ -1210,13 +1209,13 @@ test_scan_deletion(apr_pool_t *pool) ©_op_root_abspath, db, svn_dirent_join(local_abspath, "K/K-b", pool), pool, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "K", + SVN_ERR(validate_abspath(local_abspath, "K", base_del_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/away", + SVN_ERR(validate_abspath(local_abspath, "moved/away", moved_to_abspath, pool)); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/away", + SVN_ERR(validate_abspath(local_abspath, "moved/away", copy_op_root_abspath, pool)); - SVN_TEST_ASSERT(work_del_abspath == NULL); + SVN_TEST_STRING_ASSERT(work_del_abspath, NULL); /* Subtree deletion of added tree. Start at child. */ SVN_ERR(svn_wc__db_scan_deletion( @@ -1226,9 +1225,9 @@ test_scan_deletion(apr_pool_t *pool) NULL, db, svn_dirent_join(local_abspath, "L/L-a/L-a-a", pool), pool, pool)); - SVN_TEST_ASSERT(base_del_abspath == NULL); - SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "L/L-a", + SVN_TEST_STRING_ASSERT(base_del_abspath, NULL); + SVN_TEST_STRING_ASSERT(moved_to_abspath, NULL); + SVN_ERR(validate_abspath(local_abspath, "L/L-a", work_del_abspath, pool)); /* Subtree deletion of added tree. Start at root. */ @@ -1239,9 +1238,9 @@ test_scan_deletion(apr_pool_t *pool) NULL, db, svn_dirent_join(local_abspath, "L/L-a", pool), pool, pool)); - SVN_TEST_ASSERT(base_del_abspath == NULL); - SVN_TEST_ASSERT(moved_to_abspath == NULL); - SVN_TEST_ASSERT(validate_abspath(local_abspath, "L/L-a", + SVN_TEST_STRING_ASSERT(base_del_abspath, NULL); + SVN_TEST_STRING_ASSERT(moved_to_abspath, NULL); + SVN_ERR(validate_abspath(local_abspath, "L/L-a", work_del_abspath, pool)); return SVN_NO_ERROR; Modified: subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/entries-compat.c URL: http://svn.apache.org/viewvc/subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/entries-compat.c?rev=1661981&r1=1661980&r2=1661981&view=diff ============================================================================== --- subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/entries-compat.c (original) +++ subversion/branches/svn-info-detail/subversion/tests/libsvn_wc/entries-compat.c Tue Feb 24 15:23:33 2015 @@ -87,199 +87,186 @@ static const char * const TESTING_DATA = "insert into wcroot values (1, null); " "insert into pristine values ('$sha1$" SHA1_1 "', NULL, 15, 1, '$md5 $" MD5_1 "'); " + ); - /* ### The file_externals column in NODES is temporary, and will be - ### removed. However, to keep the tests passing, we need to add it - ### to the following insert statements. *Be sure to remove it*. */ +#define NOT_MOVED FALSE, NULL +#define NO_COPY_FROM 0, NULL, SVN_INVALID_REVNUM +static const svn_test__nodes_data_t nodes[] = +{ /* load the base nodes into the nodes table */ - "insert into nodes values (" - " 1, '', 0, null, 1, '', 1, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'A', 0, '', 1, 'A', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'B', 0, '', 1, 'B', null, 'excluded'," - " null, null, 'symlink', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'C', 0, '', 1, 'C', null, 'server-excluded'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'D', 0, '', 1, 'D', null, 'not-present'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'E', 0, '', 1, 'E', null, 'incomplete'," - " null, null, 'unknown', null, null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'F', 0, '', 1, 'F', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'G', 0, '', 2, 'G-alt', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'H', 0, '', 1, 'H', 1, 'normal'," - " null, null, 'symlink', '()', null, null, 'H-target', 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'I', 0, '', 1, 'I', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J', 0, '', 1, 'J', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e', 0, 'J', 1, 'J/J-e', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-a', 0, 'J/J-e', 1, 'J/J-e/J-e-a', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b', 0, 'J/J-e', 1, 'J/J-e/J-e-b', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b/Jeba', 0, 'J/J-e/J-e-b', 1, 'J/J-e/J-e-b/Jeba', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f', 0, 'J', 1, 'J/J-f', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f/J-f-a', 0, 'J/J-f', 1, 'J/J-f/J-f-a', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K', 0, '', 1, 'K', 1, 'normal'," - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-a', 0, 'K', 1, 'K/K-a', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-b', 0, 'K', 1, 'K/K-b', 1, 'normal'," - " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "'," - " 15, null, null, null, null);" - "" + { 0, "", "normal", 1, "", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "A", "normal", 1, "A", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "B", "excluded", 1, "B", 1, NOT_MOVED, + svn_node_symlink}, + + { 0, "C", "server-excluded",1, "C", 0, NOT_MOVED, + svn_node_unknown}, + + { 0, "D", "not-present", 1, "D", 0, NOT_MOVED, + svn_node_unknown}, + + { 0, "E", "incomplete", 1, "E", SVN_INVALID_REVNUM, NOT_MOVED, + svn_node_unknown}, + + { 0, "F", "normal", 1, "G-alt", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "G", "normal", 1, "G-alt", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "H", "normal", 1, "I", 1, NOT_MOVED, + svn_node_symlink, NULL, NULL, NULL, "H-target", 1, TIME_1a, AUTHOR_1}, + + { 0, "I", "normal", 1, "I", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J", "normal", 1, "J", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-c", "normal", 1, "J/J-c", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-c/J-c-a", "not-present", 1, "J/J-c/J-c-a", 1, NOT_MOVED, + svn_node_dir}, + + { 0, "J/J-e", "normal", 1, "J/J-e", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-e/J-e-a", "normal", 1, "J/J-e/J-e-a", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-e/J-e-b", "normal", 1, "J/J-e/J-e-b", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-e/J-e-b/Jeba", "normal", 1, "J/J-e/J-e-b/Jeba", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-f", "normal", 1, "J/J-f", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "J/J-f/J-f-a", "normal", 1, "J/J-f/J-f-a", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "K", "normal", 1, "K", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "K/K-a", "normal", 1, "K/K-a", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "K/K-b", "normal", 1, "K/K-b", 1, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "L", "normal", 1, "switched", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "L/L-a", "normal", 1, "switched/L-a", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 0, "L/L-a/L-a-a", "normal", 1, "switched/L-a/L-a-a", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + /* Load data into NODES table; ### op_depths have not been calculated by me yet; the value 1 is just 'good enough' to make the nodes WORKING nodes. */ - "insert into nodes values (" - " 1, 'I', 1, '', 2, 'some/dir', 2, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J', 1, '', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-a', 1, 'J', null, null, null, 'normal'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b', 1, 'J', 2, 'some/dir', 2, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b/J-b-a', 1, 'J/J-b', 2, 'another/dir', 2, 'normal'," - " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-b/J-b-b', 1, 'J/J-b', null, null, null, 'normal'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c', 1, 'J', null, null, null, 'not-present'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-c/J-c-a', 1, 'J/J-c', null, null, null, 'not-present'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-d', 1, 'J', 2, 'moved/file', 2, 'normal'," - " 1, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "'," - " 10, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e', 1, 'J', null, null, null, 'not-present'," - " null, 'other/place', 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-a', 1, 'J/J-e', null, null, null, 'not-present'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b', 1, 'J/J-e', null, null, null, 'not-present'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-e/J-e-b/Jeba', 1, 'J/J-e/J-e-b', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f', 1, 'J', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'J/J-f/J-f-a', 1, 'J/J-f', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K', 1, '', null, null, null, 'base-deleted'," - " null, null, 'dir', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-a', 1, 'K', null, null, null, 'base-deleted'," - " null, null, 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'K/K-b', 1, 'K', null, null, null, 'base-deleted'," - " null, 'moved/away', 'file', '()', null, null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L', 1, '', null, null, null, 'normal'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a', 1, 'L', null, null, null, 'not-present'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'L/L-a/L-a-a', 1, 'L/L-a', null, null, null, 'not-present'," - " null, null, 'dir', '()', 'immediates', null, null, null, null, null," - " null, null, null, null, null);" - "insert into actual_node values (" - " 1, 'I', '', null, null, null, null, null, 'changelist', null, " - " null, null, null, null, null);" - "insert into actual_node values (" - " 1, 'F', '', null, null, null, null, null, null, null, " - " '" F_TC_DATA "', null, null, null, null);" - "insert into actual_node values (" - " 1, 'G', '', null, null, null, null, null, null, null, " - " '" G_TC_DATA "', null, null, null, null);" - " " - "insert into nodes values (" - " 1, 'M', 0, '', 1, 'M', 1, 'normal', " - " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "', " - " null, null, null, null, null);" - "insert into nodes values (" - " 1, 'M/M-a', 0, 'M', 1, 'M/M-a', 1, 'not-present', " - " null, null, 'file', '()', null, null, null, 1, null, null, " - " null, null, null, null, null);" - ); + + { 1, "I", "normal", 2, "some/file", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2}, + + { 1, "J", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_dir, NULL, "immediates"}, + + { 2, "J/J-a", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 2, "J/J-b", "normal", 2, "some/dir", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2}, + + { 3, "J/J-b/J-b-a", "normal", 2, "another/dir", 2, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 2, TIME_2a, AUTHOR_2}, + + { 3, "J/J-b/J-b-b", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + /* This triggers a validation warning: bad delete */ + { 1, "J/J-c", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "J/J-d", "normal", 2, "moved/file", 2, NOT_MOVED, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 2, TIME_2a, AUTHOR_2}, + + { 1, "J/J-e", "base-deleted", NO_COPY_FROM, FALSE, "other/place", + svn_node_dir}, + + { 1, "J/J-e/J-e-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 1, "J/J-e/J-e-b", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "J/J-e/J-e-b/Jeba", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 1, "J/J-f", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 2, "J/J-f", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_dir, NULL, "immediates"}, + + { 1, "J/J-f/J-f-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "K", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "K/K-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_file}, + + { 1, "K/K-b", "base-deleted", NO_COPY_FROM, FALSE, "moved/away", + svn_node_file}, + + { 1, "L", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_dir, NULL, "immediates"}, + + { 1, "L/L-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "L/L-a/L-a-a", "base-deleted", NO_COPY_FROM, NOT_MOVED, + svn_node_dir}, + + { 1, "M", "normal", 1, "M", 1, NOT_MOVED, + svn_node_dir, "()", "infinity", NULL, NULL, 1, TIME_1a, AUTHOR_1}, + + { 1, "M/M-a", "not-present", 1, "M/M-a", 1, NOT_MOVED, + svn_node_file}, + + /**** Move target of K/K-b ****/ + { 1, "moved", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_dir, NULL, "infinity" }, + { 2, "moved/away", "normal", 1, "??", 1, TRUE, NULL, + svn_node_file, "()", NULL, "$sha1$" SHA1_1, NULL, 1, TIME_1a, AUTHOR_1}, + + /**** Move target of J/J-e ****/ + { 1, "other", "normal", NO_COPY_FROM, NOT_MOVED, + svn_node_dir, NULL, "empty"}, + + { 2, "other/place", "normal", 1, "??", 1, TRUE, NULL, + svn_node_dir, "()", "infinity"}, + + { 0 }, +}; + +static const svn_test__actual_data_t actuals[] = +{ + { "I", NULL, "changelist", NULL }, + { "F", NULL, NULL, NULL /* TC-DATA */ }, + { "G", NULL, NULL, NULL /* TC-DATA */ }, + { 0 }, +}; static const char * const M_TESTING_DATA = ( @@ -310,7 +297,8 @@ 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)); + SVN_ERR(svn_test__create_fake_wc(wc_abspath, TESTING_DATA, nodes, actuals, + pool)); return SVN_NO_ERROR; } @@ -365,8 +353,8 @@ test_entries_alloc(apr_pool_t *pool) SVN_ERR(svn_wc_entries_read(&entries, adm_access, TRUE /* show_hidden */, pool)); - /* The wcroot has 12 BASE children + 1 WORKING child + "this dir". */ - SVN_TEST_ASSERT(apr_hash_count(entries) == 14); + /* The wcroot has 12 BASE children + 3 WORKING child + "this dir". */ + SVN_TEST_ASSERT(apr_hash_count(entries) == 16); /* The "D" entry in the entries hash should be what we get from the svn_wc_entry() entrypoint. */ @@ -406,7 +394,7 @@ test_stubs(apr_pool_t *pool) SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool)); M_dir = svn_dirent_join(local_abspath, "M", pool); - SVN_ERR(svn_test__create_fake_wc(M_dir, M_TESTING_DATA, pool)); + SVN_ERR(svn_test__create_fake_wc(M_dir, M_TESTING_DATA, NULL, NULL, pool)); /* The "M" entry is a subdir. Let's ensure we can reach its stub, and the actual contents. */
