summaryrefslogtreecommitdiff
path: root/tests/libgit2/transports/smart/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libgit2/transports/smart/packet.c')
-rw-r--r--tests/libgit2/transports/smart/packet.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/tests/libgit2/transports/smart/packet.c b/tests/libgit2/transports/smart/packet.c
index 8801ef833..2035e3b65 100644
--- a/tests/libgit2/transports/smart/packet.c
+++ b/tests/libgit2/transports/smart/packet.c
@@ -11,8 +11,9 @@ static void assert_flush_parses(const char *line)
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_FLUSH);
cl_assert_equal_strn(endptr, line + 4, linelen - 4);
@@ -24,8 +25,9 @@ static void assert_data_pkt_parses(const char *line, const char *expected_data,
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_data *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_DATA);
cl_assert_equal_i(pkt->len, expected_len);
cl_assert_equal_strn(pkt->data, expected_data, expected_len);
@@ -38,8 +40,9 @@ static void assert_sideband_progress_parses(const char *line, const char *expect
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_progress *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_PROGRESS);
cl_assert_equal_i(pkt->len, expected_len);
cl_assert_equal_strn(pkt->data, expected_data, expected_len);
@@ -52,8 +55,9 @@ static void assert_error_parses(const char *line, const char *expected_error, si
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_err *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_ERR);
cl_assert_equal_i(pkt->len, expected_len);
cl_assert_equal_strn(pkt->error, expected_error, expected_len);
@@ -67,10 +71,11 @@ static void assert_ack_parses(const char *line, const char *expected_oid, enum g
const char *endptr;
git_pkt_ack *pkt;
git_oid oid;
+ git_pkt_parse_data pkt_parse_data = { 0 };
cl_git_pass(git_oid__fromstr(&oid, expected_oid, GIT_OID_SHA1));
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_ACK);
cl_assert_equal_oid(&pkt->oid, &oid);
cl_assert_equal_i(pkt->status, expected_status);
@@ -83,8 +88,9 @@ static void assert_nak_parses(const char *line)
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_NAK);
cl_assert_equal_strn(endptr, line + 7, linelen - 7);
@@ -96,8 +102,9 @@ static void assert_comment_parses(const char *line, const char *expected_comment
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_comment *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_COMMENT);
cl_assert_equal_strn(pkt->comment, expected_comment, strlen(expected_comment));
@@ -109,8 +116,9 @@ static void assert_ok_parses(const char *line, const char *expected_ref)
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_ok *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_OK);
cl_assert_equal_strn(pkt->ref, expected_ref, strlen(expected_ref));
@@ -122,8 +130,9 @@ static void assert_unpack_parses(const char *line, bool ok)
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_unpack *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_UNPACK);
cl_assert_equal_i(pkt->unpack_ok, ok);
@@ -135,8 +144,9 @@ static void assert_ng_parses(const char *line, const char *expected_ref, const c
size_t linelen = strlen(line) + 1;
const char *endptr;
git_pkt_ng *pkt;
+ git_pkt_parse_data pkt_parse_data = { 0 };
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_NG);
cl_assert_equal_strn(pkt->ref, expected_ref, strlen(expected_ref));
cl_assert_equal_strn(pkt->msg, expected_msg, strlen(expected_msg));
@@ -153,10 +163,11 @@ static void assert_ref_parses_(const char *line, size_t linelen, const char *exp
const char *endptr;
git_pkt_ref *pkt;
git_oid oid;
+ git_pkt_parse_data pkt_parse_data = { 0 };
cl_git_pass(git_oid__fromstr(&oid, expected_oid, GIT_OID_SHA1));
- cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
+ cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen, &pkt_parse_data));
cl_assert_equal_i(pkt->type, GIT_PKT_REF);
cl_assert_equal_oid(&pkt->head.oid, &oid);
cl_assert_equal_strn(pkt->head.name, expected_ref, strlen(expected_ref));
@@ -171,8 +182,10 @@ static void assert_ref_parses_(const char *line, size_t linelen, const char *exp
static void assert_pkt_fails(const char *line)
{
const char *endptr;
+ git_pkt_parse_data pkt_parse_data = { 0 };
+
git_pkt *pkt;
- cl_git_fail(git_pkt_parse_line(&pkt, &endptr, line, strlen(line) + 1));
+ cl_git_fail(git_pkt_parse_line(&pkt, &endptr, line, strlen(line) + 1, &pkt_parse_data));
}
void test_transports_smart_packet__parsing_garbage_fails(void)