You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2011/02/09 06:59:37 UTC

svn commit: r1068757 - in /subversion/trunk/subversion/tests/libsvn_diff: B2 B2new T1 T2 T3 diff-diff3-test.c

Author: danielsh
Date: Wed Feb  9 05:59:37 2011
New Revision: 1068757

URL: http://svn.apache.org/viewvc?rev=1068757&view=rev
Log:
Fix some builds by generating the temporary files.

* subversion/tests/libsvn_diff/diff-diff3-test.c
  (test_diff4): Generate the files instead of finding them at cwd.

* subversion/tests/libsvn_diff/B2
* subversion/tests/libsvn_diff/T1
* subversion/tests/libsvn_diff/T2
* subversion/tests/libsvn_diff/T3
* subversion/tests/libsvn_diff/B2new
    These are now generated files.

Removed:
    subversion/trunk/subversion/tests/libsvn_diff/B2
    subversion/trunk/subversion/tests/libsvn_diff/B2new
    subversion/trunk/subversion/tests/libsvn_diff/T1
    subversion/trunk/subversion/tests/libsvn_diff/T2
    subversion/trunk/subversion/tests/libsvn_diff/T3
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=1068757&r1=1068756&r2=1068757&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Wed Feb  9 05:59:37 2011
@@ -2049,12 +2049,97 @@ test_three_way_merge_conflict_styles(apr
 }
 
 
+#define MAKE_STRING(cstr) { (cstr), sizeof((cstr))-1 }
+
 static svn_error_t *
 test_diff4(apr_pool_t *pool)
 {
   svn_diff_t *diff;
   svn_stream_t *actual, *expected;
   svn_boolean_t same;
+  static svn_string_t B2 = MAKE_STRING(
+    "int main (int argc, char **argv)\n"
+    "{\n"
+    "  /* line minus-five of context */\n"
+    "  /* line minus-four of context */\n"
+    "  /* line minus-three of context */\n"
+    "  /* line -1 of context */\n"
+    "  printf (\"Hello, world!\\n\");\n"
+    "  /* newly inserted line of context */\n"
+    "  /* line plus-one of context */\n"
+    "  /* line plus-two of context */\n"
+    "  /* line plus-three of context */\n"
+    "  /* line plus-four of context */\n"
+    "  /* line plus-five of context */\n"
+    "}\n");
+  static svn_string_t B2new = MAKE_STRING(
+    "int main (int argc, char **argv)\n"
+    "{\n"
+    "  /* line minus-five of context */\n"
+    "  /* line minus-four of context */\n"
+    "  /* line minus-three of context */\n"
+    "  /* line -1 of context */\n"
+    "  printf (\"Good-bye, cruel world!\\n\");\n"
+    "  /* newly inserted line of context */\n"
+    "  /* line plus-one of context */\n"
+    "  /* line plus-two of context */\n"
+    "  /* line plus-three of context */\n"
+    "  /* line plus-four of context */\n"
+    "  /* line plus-five of context */\n"
+    "}\n");
+  static svn_string_t T1 = MAKE_STRING(
+    "int main (int argc, char **argv)\n"
+    "{\n"
+    "  /* line minus-five of context */\n"
+    "  /* line minus-four of context */\n"
+    "  /* line minus-three of context */\n"
+    "  /* line minus-two of context */\n"
+    "  /* line minus-one of context */\n"
+    "  printf (\"Hello, world!\\n\");\n"
+    "  /* line plus-one of context */\n"
+    "  /* line plus-two of context */\n"
+    "  /* line plus-three of context */\n"
+    "  /* line plus-four of context */\n"
+    "  /* line plus-five of context */\n"
+    "}\n");
+  static svn_string_t T2 = MAKE_STRING(
+    "#include <stdio.h>\n"
+    "\n"
+    "int main (int argc, char **argv)\n"
+    "{\n"
+    "  /* line minus-five of context */\n"
+    "  /* line minus-four of context */\n"
+    "  /* line minus-three of context */\n"
+    "  /* line minus-two of context */\n"
+    "  /* line minus-one of context */\n"
+    "  printf (\"Hello, world!\\n\");\n"
+    "  /* line plus-one of context */\n"
+    "  /* line plus-two of context */\n"
+    "  /* line plus-three of context */\n"
+    "  /* line plus-four of context */\n"
+    "  /* line plus-five of context */\n"
+    "}\n");
+  static svn_string_t T3 = MAKE_STRING(
+    "#include <stdio.h>\n"
+    "\n"
+    "int main (int argc, char **argv)\n"
+    "{\n"
+    "  /* line minus-five of context */\n"
+    "  /* line minus-four of context */\n"
+    "  /* line minus-three of context */\n"
+    "  /* line minus-two of context */\n"
+    "  /* line minus-one of context */\n"
+    "  printf (\"Good-bye, cruel world!\\n\");\n"
+    "  /* line plus-one of context */\n"
+    "  /* line plus-two of context */\n"
+    "  /* line plus-three of context */\n"
+    "  /* line plus-four of context */\n"
+    "  /* line plus-five of context */\n"
+    "}\n");
+  SVN_ERR(make_file("B2", B2.data, pool));
+  SVN_ERR(make_file("T1", T1.data, pool));
+  SVN_ERR(make_file("T2", T2.data, pool));
+  SVN_ERR(make_file("T3", T3.data, pool));
 
   /* Usage: tools/diff/diff4 <mine> <older> <yours> <ancestor> */
   /* tools/diff/diff4 B2 T2 T3 T1 > B2new */
@@ -2065,7 +2150,8 @@ test_diff4(apr_pool_t *pool)
   SVN_TEST_ASSERT(svn_diff_contains_diffs(diff));
 
   /* Comparison. */
-  SVN_ERR(svn_stream_open_readonly(&expected, "B2new", pool, pool));
+  expected = svn_stream_from_string(&B2new, pool);
+
   actual = svn_stream_from_stringbuf(
              svn_stringbuf_create_ensure(417, pool), /* 417 == wc -c < B2new */
              pool);