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
7e527ca7
Commit
7e527ca7
authored
Mar 21, 2013
by
Xavier L
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test case for new function
parent
0c8efb38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
tests-clar/core/oid.c
+14
-0
No files found.
tests-clar/core/oid.c
View file @
7e527ca7
#include "clar_libgit2.h"
#include "clar_libgit2.h"
static
git_oid
id
;
static
git_oid
id
;
static
git_oid
idp
;
static
git_oid
idm
;
const
char
*
str_oid
=
"ae90f12eea699729ed24555e40b9fd669da12a12"
;
const
char
*
str_oid
=
"ae90f12eea699729ed24555e40b9fd669da12a12"
;
const
char
*
str_oid_p
=
"ae90f12eea699729ed"
;
const
char
*
str_oid_m
=
"ae90f12eea699729ed24555e40b9fd669da12a12oiahs"
;
void
test_core_oid__initialize
(
void
)
void
test_core_oid__initialize
(
void
)
{
{
cl_git_pass
(
git_oid_fromstr
(
&
id
,
str_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
id
,
str_oid
));
cl_git_pass
(
git_oid_fromstrp
(
&
idp
,
str_oid_p
));
cl_git_pass
(
git_oid_fromstrp
(
&
idm
,
str_oid_m
));
}
}
void
test_core_oid__streq
(
void
)
void
test_core_oid__streq
(
void
)
...
@@ -15,4 +21,12 @@ void test_core_oid__streq(void)
...
@@ -15,4 +21,12 @@ void test_core_oid__streq(void)
cl_assert
(
git_oid_streq
(
&
id
,
"deadbeef"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
id
,
"deadbeef"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
id
,
"I'm not an oid.... :)"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
id
,
"I'm not an oid.... :)"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
idp
,
"ae90f12eea699729ed0000000000000000000000"
)
==
0
);
cl_assert
(
git_oid_streq
(
&
idp
,
"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
idp
,
"deadbeef"
)
==
-
1
);
cl_assert
(
git_oid_streq
(
&
idp
,
"I'm not an oid.... :)"
)
==
-
1
);
cl_assert
(
git_oid_cmp
(
&
id
,
&
idm
)
==
0
);
}
}
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