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
a655cc35
Commit
a655cc35
authored
Aug 04, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #353 from belkiss/development
Fix wrong test in t04-commit
parents
98bc99be
9d76b934
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
tests/t01-rawobj.c
+5
-5
tests/t04-commit.c
+6
-6
No files found.
tests/t01-rawobj.c
View file @
a655cc35
...
@@ -204,7 +204,7 @@ BEGIN_TEST(oid11, "compare formated oids")
...
@@ -204,7 +204,7 @@ BEGIN_TEST(oid11, "compare formated oids")
/* Format produced the right result */
/* Format produced the right result */
out
[
GIT_OID_HEXSZ
]
=
'\0'
;
out
[
GIT_OID_HEXSZ
]
=
'\0'
;
must_
pass
(
strcmp
(
exp
,
out
)
);
must_
be_true
(
strcmp
(
exp
,
out
)
==
0
);
END_TEST
END_TEST
BEGIN_TEST
(
oid12
,
"compare oids (allocate + format)"
)
BEGIN_TEST
(
oid12
,
"compare oids (allocate + format)"
)
...
@@ -216,7 +216,7 @@ BEGIN_TEST(oid12, "compare oids (allocate + format)")
...
@@ -216,7 +216,7 @@ BEGIN_TEST(oid12, "compare oids (allocate + format)")
out
=
git_oid_allocfmt
(
&
in
);
out
=
git_oid_allocfmt
(
&
in
);
must_be_true
(
out
);
must_be_true
(
out
);
must_
pass
(
strcmp
(
exp
,
out
)
);
must_
be_true
(
strcmp
(
exp
,
out
)
==
0
);
free
(
out
);
free
(
out
);
END_TEST
END_TEST
...
@@ -235,7 +235,7 @@ BEGIN_TEST(oid13, "compare oids (path format)")
...
@@ -235,7 +235,7 @@ BEGIN_TEST(oid13, "compare oids (path format)")
/* Format produced the right result */
/* Format produced the right result */
out
[
GIT_OID_HEXSZ
+
1
]
=
'\0'
;
out
[
GIT_OID_HEXSZ
+
1
]
=
'\0'
;
must_
pass
(
strcmp
(
exp2
,
out
)
);
must_
be_true
(
strcmp
(
exp2
,
out
)
==
0
);
END_TEST
END_TEST
BEGIN_TEST
(
oid14
,
"convert raw oid to string"
)
BEGIN_TEST
(
oid14
,
"convert raw oid to string"
)
...
@@ -279,7 +279,7 @@ BEGIN_TEST(oid14, "convert raw oid to string")
...
@@ -279,7 +279,7 @@ BEGIN_TEST(oid14, "convert raw oid to string")
/* returns out as hex formatted c-string */
/* returns out as hex formatted c-string */
str
=
git_oid_to_string
(
out
,
sizeof
(
out
),
&
in
);
str
=
git_oid_to_string
(
out
,
sizeof
(
out
),
&
in
);
must_be_true
(
str
&&
str
==
out
&&
*
(
str
+
GIT_OID_HEXSZ
)
==
'\0'
);
must_be_true
(
str
&&
str
==
out
&&
*
(
str
+
GIT_OID_HEXSZ
)
==
'\0'
);
must_
pass
(
strcmp
(
exp
,
out
)
);
must_
be_true
(
strcmp
(
exp
,
out
)
==
0
);
END_TEST
END_TEST
BEGIN_TEST
(
oid15
,
"convert raw oid to string (big)"
)
BEGIN_TEST
(
oid15
,
"convert raw oid to string (big)"
)
...
@@ -299,7 +299,7 @@ BEGIN_TEST(oid15, "convert raw oid to string (big)")
...
@@ -299,7 +299,7 @@ BEGIN_TEST(oid15, "convert raw oid to string (big)")
/* returns big as hex formatted c-string */
/* returns big as hex formatted c-string */
str
=
git_oid_to_string
(
big
,
sizeof
(
big
),
&
in
);
str
=
git_oid_to_string
(
big
,
sizeof
(
big
),
&
in
);
must_be_true
(
str
&&
str
==
big
&&
*
(
str
+
GIT_OID_HEXSZ
)
==
'\0'
);
must_be_true
(
str
&&
str
==
big
&&
*
(
str
+
GIT_OID_HEXSZ
)
==
'\0'
);
must_
pass
(
strcmp
(
exp
,
big
)
);
must_
be_true
(
strcmp
(
exp
,
big
)
==
0
);
/* check tail material is untouched */
/* check tail material is untouched */
must_be_true
(
str
&&
str
==
big
&&
*
(
str
+
GIT_OID_HEXSZ
+
1
)
==
'X'
);
must_be_true
(
str
&&
str
==
big
&&
*
(
str
+
GIT_OID_HEXSZ
+
1
)
==
'X'
);
...
...
tests/t04-commit.c
View file @
a655cc35
...
@@ -461,8 +461,8 @@ static int try_build_signature(const char *name, const char *email, git_time_t t
...
@@ -461,8 +461,8 @@ static int try_build_signature(const char *name, const char *email, git_time_t t
BEGIN_TEST
(
signature0
,
"creating a signature trims leading and trailing spaces"
)
BEGIN_TEST
(
signature0
,
"creating a signature trims leading and trailing spaces"
)
git_signature
*
sign
;
git_signature
*
sign
;
must_pass
(
git_signature_new
(
&
sign
,
" nulltoken "
,
" emeric.fermas@gmail.com "
,
1234567890
,
60
));
must_pass
(
git_signature_new
(
&
sign
,
" nulltoken "
,
" emeric.fermas@gmail.com "
,
1234567890
,
60
));
must_
pass
(
strcmp
(
sign
->
name
,
"nulltoken"
)
);
must_
be_true
(
strcmp
(
sign
->
name
,
"nulltoken"
)
==
0
);
must_
pass
(
strcmp
(
sign
->
email
,
"emeric.fermas@gmail.com"
)
);
must_
be_true
(
strcmp
(
sign
->
email
,
"emeric.fermas@gmail.com"
)
==
0
);
git_signature_free
((
git_signature
*
)
sign
);
git_signature_free
((
git_signature
*
)
sign
);
END_TEST
END_TEST
...
@@ -478,16 +478,16 @@ END_TEST
...
@@ -478,16 +478,16 @@ END_TEST
BEGIN_TEST
(
signature2
,
"creating a one character signature"
)
BEGIN_TEST
(
signature2
,
"creating a one character signature"
)
git_signature
*
sign
;
git_signature
*
sign
;
must_pass
(
git_signature_new
(
&
sign
,
"x"
,
"foo@bar.baz"
,
1234567890
,
60
));
must_pass
(
git_signature_new
(
&
sign
,
"x"
,
"foo@bar.baz"
,
1234567890
,
60
));
must_
pass
(
strcmp
(
sign
->
name
,
"x"
)
);
must_
be_true
(
strcmp
(
sign
->
name
,
"x"
)
==
0
);
must_
pass
(
strcmp
(
sign
->
email
,
"foo@bar.baz"
)
);
must_
be_true
(
strcmp
(
sign
->
email
,
"foo@bar.baz"
)
==
0
);
git_signature_free
((
git_signature
*
)
sign
);
git_signature_free
((
git_signature
*
)
sign
);
END_TEST
END_TEST
BEGIN_TEST
(
signature3
,
"creating a two character signature"
)
BEGIN_TEST
(
signature3
,
"creating a two character signature"
)
git_signature
*
sign
;
git_signature
*
sign
;
must_pass
(
git_signature_new
(
&
sign
,
"xx"
,
"x@y.z"
,
1234567890
,
60
));
must_pass
(
git_signature_new
(
&
sign
,
"xx"
,
"x@y.z"
,
1234567890
,
60
));
must_
pass
(
strcmp
(
sign
->
name
,
"x"
)
);
must_
be_true
(
strcmp
(
sign
->
name
,
"xx"
)
==
0
);
must_
pass
(
strcmp
(
sign
->
email
,
"foo@bar.baz"
)
);
must_
be_true
(
strcmp
(
sign
->
email
,
"x@y.z"
)
==
0
);
git_signature_free
((
git_signature
*
)
sign
);
git_signature_free
((
git_signature
*
)
sign
);
END_TEST
END_TEST
...
...
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