diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-11-09 08:23:27 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-11-25 15:38:22 -0500 |
commit | dcde5720424961f526e8c070b7d99191d7ef75c1 (patch) | |
tree | 5dcd085a370ce66bb9cd39aa280e61676716ef57 | |
parent | 76ade3a0b87e279935eba54be2485105396edb7f (diff) | |
download | libgit2-dcde5720424961f526e8c070b7d99191d7ef75c1.tar.gz |
merge tests: move expected data into own file
-rw-r--r-- | tests/merge/conflict_data.h | 42 | ||||
-rw-r--r-- | tests/merge/files.c | 1 | ||||
-rw-r--r-- | tests/merge/merge_helpers.h | 43 | ||||
-rw-r--r-- | tests/merge/trees/automerge.c | 3 | ||||
-rw-r--r-- | tests/merge/trees/commits.c | 1 | ||||
-rw-r--r-- | tests/merge/workdir/simple.c | 1 |
6 files changed, 47 insertions, 44 deletions
diff --git a/tests/merge/conflict_data.h b/tests/merge/conflict_data.h new file mode 100644 index 000000000..173892d95 --- /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 2d55df2b2..daa73fada 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 554c24b7c..e407c7d13 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 c18881d7c..67f2cf786 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 dd1e383ac..786a77a8b 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 abc0777f7..3cdd15b5a 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" |