Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
bcba8460
Commit
bcba8460
authored
Sep 16, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes to t18
...Ops, I broke the old test when porting it to Clay.
parent
11385c3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletions
+37
-1
tests/t18-status.c
+37
-1
No files found.
tests/t18-status.c
View file @
bcba8460
...
...
@@ -48,6 +48,20 @@ static int file_create(const char *filename, const char *content)
return
GIT_SUCCESS
;
}
BEGIN_TEST
(
file0
,
"test retrieving OID from a file apart from the ODB"
)
git_oid
expected_id
,
actual_id
;
char
filename
[]
=
"new_file"
;
must_pass
(
file_create
(
filename
,
"new_file
\n\0
"
));
must_pass
(
git_odb_hashfile
(
&
actual_id
,
filename
,
GIT_OBJ_BLOB
));
must_pass
(
git_oid_fromstr
(
&
expected_id
,
test_blob_oid
));
must_be_true
(
git_oid_cmp
(
&
expected_id
,
&
actual_id
)
==
0
);
must_pass
(
p_unlink
(
filename
));
END_TEST
static
const
char
*
entry_paths0
[]
=
{
"file_deleted"
,
"modified_file"
,
...
...
@@ -86,6 +100,15 @@ static const unsigned int entry_statuses0[] = {
#define ENTRY_COUNT0 14
struct
status_entry_counts
{
int
wrong_status_flags_count
;
int
wrong_sorted_path
;
int
entry_count
;
const
unsigned
int
*
expected_statuses
;
const
char
**
expected_paths
;
int
expected_entry_count
;
};
static
int
status_cb
(
const
char
*
path
,
unsigned
int
status_flags
,
void
*
payload
)
{
struct
status_entry_counts
*
counts
=
(
struct
status_entry_counts
*
)
payload
;
...
...
@@ -131,6 +154,18 @@ BEGIN_TEST(statuscb0, "test retrieving status for worktree of repository")
git_futils_rmdir_r
(
TEMP_REPO_FOLDER
,
1
);
END_TEST
static
int
status_cb1
(
const
char
*
path
,
unsigned
int
status_flags
,
void
*
payload
)
{
int
*
count
=
(
int
*
)
payload
;;
GIT_UNUSED_ARG
(
path
);
GIT_UNUSED_ARG
(
status_flags
);
*
count
++
;
return
GIT_SUCCESS
;
}
BEGIN_TEST
(
statuscb1
,
"test retrieving status for a worktree of an empty repository"
)
git_repository
*
repo
;
int
count
=
0
;
...
...
@@ -410,4 +445,4 @@ BEGIN_SUITE(status)
ADD_TEST
(
singlestatus2
);
ADD_TEST
(
singlestatus3
);
ADD_TEST
(
singlestatus4
);
END_SUITE
END_SUITE
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment