subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1295425 - /subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
Date Thu, 01 Mar 2012 06:28:08 GMT
Author: danielsh
Date: Thu Mar  1 06:28:08 2012
New Revision: 1295425

URL: http://svn.apache.org/viewvc?rev=1295425&view=rev
Log:
Add a regression test for issue #4133, '"diff -x -w" showing wrong change'.

* subversion/tests/libsvn_diff/diff-diff3-test.c
  (test_wrap): New test.
  (test_list): Run it, XFail.

Modified:
    subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c

Modified: subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c?rev=1295425&r1=1295424&r2=1295425&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Thu Mar  1 06:28:08 2012
@@ -2394,7 +2394,37 @@ merge_adjacent_changes(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+/* Issue #4133, '"diff -x -w" showing wrong change'. */
+static svn_error_t *
+test_wrap(apr_pool_t *pool)
+{
+  char ldata[(1<<17) + 4+4+3+1];
+  char rdata[(1<<17) + 4+3+3+1];
+  svn_string_t left, right;
+  svn_diff_file_options_t *diff_opts = svn_diff_file_options_create(pool);
+  diff_opts->ignore_space = TRUE;
 
+  /* Two long lines. */
+  memset(ldata, '@', 1<<17);
+  memset(rdata, '@', 1<<17);
+  strcpy(&ldata[1<<17], "foo\n" "ba \n" "x \n");
+  strcpy(&rdata[1<<17], "foo\n" "ba\n"  "x\t\n");
+
+  /* Cast them to svn_string_t. */
+  left.data = ldata;
+  right.data = rdata;
+  left.len = sizeof(ldata)-1;
+  right.len = sizeof(rdata)-1;
+
+  /* Diff them.  Modulo whitespace, they are identical. */
+  {
+    svn_diff_t *diff;
+    SVN_ERR(svn_diff_mem_string_diff(&diff, &left, &right, diff_opts, pool));
+    SVN_TEST_ASSERT(FALSE == svn_diff_contains_diffs(diff));
+  }
+
+  return SVN_NO_ERROR;
+}
 
 /* ========================================================================== */
 
@@ -2425,5 +2455,7 @@ struct svn_test_descriptor_t test_funcs[
                    "3-way merge with conflict styles"),
     SVN_TEST_PASS2(test_diff4,
                    "4-way merge; see variance-adjusted-patching.html"),
+    SVN_TEST_XFAIL2(test_wrap,
+                   "difference at the start of a 128KB window"),
     SVN_TEST_NULL
   };



Mime
View raw message