mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 20:17:59 +00:00
Updated t0401 (commit parsing) to reflect the new API changes.
Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
This commit is contained in:
parent
089c2d931b
commit
d047b47aad
@ -3,6 +3,7 @@
|
|||||||
#include "commit.h"
|
#include "commit.h"
|
||||||
#include <git/odb.h>
|
#include <git/odb.h>
|
||||||
#include <git/commit.h>
|
#include <git/commit.h>
|
||||||
|
#include <git/revwalk.h>
|
||||||
|
|
||||||
static char *test_commits_broken[] = {
|
static char *test_commits_broken[] = {
|
||||||
|
|
||||||
@ -136,10 +137,12 @@ BEGIN_TEST(parse_buffer_test)
|
|||||||
const int working_commit_count = sizeof(test_commits_working) / sizeof(*test_commits_working);
|
const int working_commit_count = sizeof(test_commits_working) / sizeof(*test_commits_working);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
git_revpool *pool = gitrp_alloc(NULL);
|
||||||
|
|
||||||
for (i = 0; i < broken_commit_count; ++i) {
|
for (i = 0; i < broken_commit_count; ++i) {
|
||||||
git_commit commit;
|
git_commit commit;
|
||||||
commit.parsed = 0;
|
memset(&commit, 0x0, sizeof(git_commit));
|
||||||
commit.pool = NULL;
|
commit.object.pool = pool;
|
||||||
|
|
||||||
must_fail(git_commit__parse_buffer(
|
must_fail(git_commit__parse_buffer(
|
||||||
&commit,
|
&commit,
|
||||||
@ -150,8 +153,8 @@ BEGIN_TEST(parse_buffer_test)
|
|||||||
|
|
||||||
for (i = 0; i < working_commit_count; ++i) {
|
for (i = 0; i < working_commit_count; ++i) {
|
||||||
git_commit commit;
|
git_commit commit;
|
||||||
commit.parsed = 0;
|
memset(&commit, 0x0, sizeof(git_commit));
|
||||||
commit.pool = NULL;
|
commit.object.pool = pool;
|
||||||
|
|
||||||
must_pass(git_commit__parse_buffer(
|
must_pass(git_commit__parse_buffer(
|
||||||
&commit,
|
&commit,
|
||||||
@ -160,4 +163,6 @@ BEGIN_TEST(parse_buffer_test)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gitrp_free(pool);
|
||||||
|
|
||||||
END_TEST
|
END_TEST
|
||||||
|
Loading…
Reference in New Issue
Block a user