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
5a386e4d
Commit
5a386e4d
authored
Dec 11, 2010
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added timezone checks to person parsing tests.
parent
7161beb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
tests/t0401-parse.c
+16
-10
No files found.
tests/t0401-parse.c
View file @
5a386e4d
...
@@ -131,7 +131,7 @@ END_TEST
...
@@ -131,7 +131,7 @@ END_TEST
BEGIN_TEST
(
parse_person_test
)
BEGIN_TEST
(
parse_person_test
)
#define TEST_PERSON_PASS(_string, _header, _name, _email, _time)
{
\
#define TEST_PERSON_PASS(_string, _header, _name, _email, _time
, _offset
)
{
\
char
*
ptr
=
_string
;
\
char
*
ptr
=
_string
;
\
size_t
len
=
strlen
(
_string
);
\
size_t
len
=
strlen
(
_string
);
\
git_person
person
=
{
NULL
,
NULL
,
0
};
\
git_person
person
=
{
NULL
,
NULL
,
0
};
\
...
@@ -139,6 +139,7 @@ BEGIN_TEST(parse_person_test)
...
@@ -139,6 +139,7 @@ BEGIN_TEST(parse_person_test)
must_be_true
(
strcmp
(
_name
,
person
.
name
)
==
0
);
\
must_be_true
(
strcmp
(
_name
,
person
.
name
)
==
0
);
\
must_be_true
(
strcmp
(
_email
,
person
.
email
)
==
0
);
\
must_be_true
(
strcmp
(
_email
,
person
.
email
)
==
0
);
\
must_be_true
(
_time
==
person
.
time
);
\
must_be_true
(
_time
==
person
.
time
);
\
must_be_true
(
_offset
==
person
.
timezone_offset
);
\
free
(
person
.
name
);
free
(
person
.
email
);
\
free
(
person
.
name
);
free
(
person
.
email
);
\
}
}
...
@@ -151,25 +152,28 @@ BEGIN_TEST(parse_person_test)
...
@@ -151,25 +152,28 @@ BEGIN_TEST(parse_person_test)
}
}
TEST_PERSON_PASS
(
TEST_PERSON_PASS
(
"author Vicent Marti <tanoku@gmail.com> 12345
\n
"
,
"author Vicent Marti <tanoku@gmail.com> 12345
\n
"
,
"author "
,
"author "
,
"Vicent Marti"
,
"Vicent Marti"
,
"tanoku@gmail.com"
,
"tanoku@gmail.com"
,
12345
);
12345
,
0
);
TEST_PERSON_PASS
(
TEST_PERSON_PASS
(
"author Vicent Marti <> 12345
\n
"
,
"author Vicent Marti <> 12345
\n
"
,
"author "
,
"author "
,
"Vicent Marti"
,
"Vicent Marti"
,
""
,
""
,
12345
);
12345
,
0
);
TEST_PERSON_PASS
(
TEST_PERSON_PASS
(
"author Vicent Marti <tanoku@gmail.com> 231301 +1020
\n
"
,
"author Vicent Marti <tanoku@gmail.com> 231301 +1020
\n
"
,
"author "
,
"author "
,
"Vicent Marti"
,
"Vicent Marti"
,
"tanoku@gmail.com"
,
"tanoku@gmail.com"
,
231301
);
231301
,
620
);
TEST_PERSON_PASS
(
TEST_PERSON_PASS
(
"author Vicent Marti with an outrageously long name \
"author Vicent Marti with an outrageously long name \
...
@@ -178,7 +182,8 @@ BEGIN_TEST(parse_person_test)
...
@@ -178,7 +182,8 @@ BEGIN_TEST(parse_person_test)
"Vicent Marti with an outrageously long name \
"Vicent Marti with an outrageously long name \
which will probably overflow the buffer"
,
which will probably overflow the buffer"
,
"tanoku@gmail.com"
,
"tanoku@gmail.com"
,
12345
);
12345
,
0
);
TEST_PERSON_PASS
(
TEST_PERSON_PASS
(
"author Vicent Marti <tanokuwithaveryveryverylongemail\
"author Vicent Marti <tanokuwithaveryveryverylongemail\
...
@@ -187,7 +192,8 @@ BEGIN_TEST(parse_person_test)
...
@@ -187,7 +192,8 @@ BEGIN_TEST(parse_person_test)
"Vicent Marti"
,
"Vicent Marti"
,
"tanokuwithaveryveryverylongemail\
"tanokuwithaveryveryverylongemail\
whichwillprobablyvoverflowtheemailbuffer@gmail.com"
,
whichwillprobablyvoverflowtheemailbuffer@gmail.com"
,
12345
);
12345
,
0
);
TEST_PERSON_FAIL
(
TEST_PERSON_FAIL
(
"author Vicent Marti <tanoku@gmail.com> 12345
\n
"
,
"author Vicent Marti <tanoku@gmail.com> 12345
\n
"
,
...
...
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