merge tests: move expected data into own file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
diff --git a/tests/merge/conflict_data.h b/tests/merge/conflict_data.h
new file mode 100644
index 0000000..173892d
--- /dev/null
+++ b/tests/merge/conflict_data.h
@@ -0,0 +1,42 @@
+#define AUTOMERGEABLE_MERGED_FILE \
+ "this file is changed in master\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is automergeable\n" \
+ "this file is changed in branch\n"
+
+#define AUTOMERGEABLE_MERGED_FILE_CRLF \
+ "this file is changed in master\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is automergeable\r\n" \
+ "this file is changed in branch\r\n"
+
+#define CONFLICTING_MERGE_FILE \
+ "<<<<<<< HEAD\n" \
+ "this file is changed in master and branch\n" \
+ "=======\n" \
+ "this file is changed in branch and master\n" \
+ ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
+
+#define CONFLICTING_DIFF3_FILE \
+ "<<<<<<< HEAD\n" \
+ "this file is changed in master and branch\n" \
+ "||||||| initial\n" \
+ "this file is a conflict\n" \
+ "=======\n" \
+ "this file is changed in branch and master\n" \
+ ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
+
+#define CONFLICTING_UNION_FILE \
+ "this file is changed in master and branch\n" \
+ "this file is changed in branch and master\n"
+
diff --git a/tests/merge/files.c b/tests/merge/files.c
index 2d55df2..daa73fa 100644
--- a/tests/merge/files.c
+++ b/tests/merge/files.c
@@ -4,6 +4,7 @@
#include "buffer.h"
#include "merge.h"
#include "merge_helpers.h"
+#include "conflict_data.h"
#include "refs.h"
#include "fileops.h"
#include "diff_xdiff.h"
diff --git a/tests/merge/merge_helpers.h b/tests/merge/merge_helpers.h
index 554c24b..e407c7d 100644
--- a/tests/merge/merge_helpers.h
+++ b/tests/merge/merge_helpers.h
@@ -4,49 +4,6 @@
#include "merge.h"
#include "git2/merge.h"
-#define AUTOMERGEABLE_MERGED_FILE \
- "this file is changed in master\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is automergeable\n" \
- "this file is changed in branch\n"
-
-#define AUTOMERGEABLE_MERGED_FILE_CRLF \
- "this file is changed in master\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is automergeable\r\n" \
- "this file is changed in branch\r\n"
-
-#define CONFLICTING_MERGE_FILE \
- "<<<<<<< HEAD\n" \
- "this file is changed in master and branch\n" \
- "=======\n" \
- "this file is changed in branch and master\n" \
- ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
-
-#define CONFLICTING_DIFF3_FILE \
- "<<<<<<< HEAD\n" \
- "this file is changed in master and branch\n" \
- "||||||| initial\n" \
- "this file is a conflict\n" \
- "=======\n" \
- "this file is changed in branch and master\n" \
- ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n"
-
-#define CONFLICTING_UNION_FILE \
- "this file is changed in master and branch\n" \
- "this file is changed in branch and master\n"
-
-
struct merge_index_entry {
uint16_t mode;
char oid_str[GIT_OID_HEXSZ+1];
diff --git a/tests/merge/trees/automerge.c b/tests/merge/trees/automerge.c
index c18881d..67f2cf7 100644
--- a/tests/merge/trees/automerge.c
+++ b/tests/merge/trees/automerge.c
@@ -3,8 +3,9 @@
#include "git2/merge.h"
#include "buffer.h"
#include "merge.h"
-#include "../merge_helpers.h"
#include "fileops.h"
+#include "../merge_helpers.h"
+#include "../conflict_data.h"
static git_repository *repo;
diff --git a/tests/merge/trees/commits.c b/tests/merge/trees/commits.c
index dd1e383..786a77a 100644
--- a/tests/merge/trees/commits.c
+++ b/tests/merge/trees/commits.c
@@ -3,6 +3,7 @@
#include "git2/merge.h"
#include "merge.h"
#include "../merge_helpers.h"
+#include "../conflict_data.h"
static git_repository *repo;
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index abc0777..3cdd15b 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -4,6 +4,7 @@
#include "buffer.h"
#include "merge.h"
#include "../merge_helpers.h"
+#include "../conflict_data.h"
#include "refs.h"
#include "fileops.h"