just use git_message_trailer in tests

parent 6062032e
#include "clar_libgit2.h" #include "clar_libgit2.h"
#include "message.h" #include "message.h"
struct trailer { static void assert_trailers(const char *message, git_message_trailer *trailers)
const char *key;
const char *value;
};
static void assert_trailers(const char *message, struct trailer *trailers)
{ {
git_message_trailer_array arr; git_message_trailer_array arr;
size_t i; size_t i;
...@@ -27,7 +22,7 @@ static void assert_trailers(const char *message, struct trailer *trailers) ...@@ -27,7 +22,7 @@ static void assert_trailers(const char *message, struct trailer *trailers)
void test_message_trailer__simple(void) void test_message_trailer__simple(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Signed-off-by", "foo@bar.com"}, {"Signed-off-by", "foo@bar.com"},
{"Signed-off-by", "someone@else.com"}, {"Signed-off-by", "someone@else.com"},
{NULL, NULL}, {NULL, NULL},
...@@ -43,7 +38,7 @@ void test_message_trailer__simple(void) ...@@ -43,7 +38,7 @@ void test_message_trailer__simple(void)
void test_message_trailer__no_whitespace(void) void test_message_trailer__no_whitespace(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Key", "value"}, {"Key", "value"},
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -57,7 +52,7 @@ void test_message_trailer__no_whitespace(void) ...@@ -57,7 +52,7 @@ void test_message_trailer__no_whitespace(void)
void test_message_trailer__extra_whitespace(void) void test_message_trailer__extra_whitespace(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Key", "value"}, {"Key", "value"},
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -71,7 +66,7 @@ void test_message_trailer__extra_whitespace(void) ...@@ -71,7 +66,7 @@ void test_message_trailer__extra_whitespace(void)
void test_message_trailer__no_newline(void) void test_message_trailer__no_newline(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Key", "value"}, {"Key", "value"},
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -85,7 +80,7 @@ void test_message_trailer__no_newline(void) ...@@ -85,7 +80,7 @@ void test_message_trailer__no_newline(void)
void test_message_trailer__not_last_paragraph(void) void test_message_trailer__not_last_paragraph(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -100,7 +95,7 @@ void test_message_trailer__not_last_paragraph(void) ...@@ -100,7 +95,7 @@ void test_message_trailer__not_last_paragraph(void)
void test_message_trailer__conflicts(void) void test_message_trailer__conflicts(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Key", "value"}, {"Key", "value"},
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -117,7 +112,7 @@ void test_message_trailer__conflicts(void) ...@@ -117,7 +112,7 @@ void test_message_trailer__conflicts(void)
void test_message_trailer__patch(void) void test_message_trailer__patch(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Key", "value"}, {"Key", "value"},
{NULL, NULL}, {NULL, NULL},
}; };
...@@ -134,7 +129,7 @@ void test_message_trailer__patch(void) ...@@ -134,7 +129,7 @@ void test_message_trailer__patch(void)
void test_message_trailer__continuation(void) void test_message_trailer__continuation(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"A", "b\n c"}, {"A", "b\n c"},
{"D", "e\n f: g h"}, {"D", "e\n f: g h"},
{"I", "j"}, {"I", "j"},
...@@ -154,7 +149,7 @@ void test_message_trailer__continuation(void) ...@@ -154,7 +149,7 @@ void test_message_trailer__continuation(void)
void test_message_trailer__invalid(void) void test_message_trailer__invalid(void)
{ {
struct trailer trailers[] = { git_message_trailer trailers[] = {
{"Signed-off-by", "some@one.com"}, {"Signed-off-by", "some@one.com"},
{"Another", "trailer"}, {"Another", "trailer"},
{NULL, NULL}, {NULL, NULL},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment