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
dd954a37
Commit
dd954a37
authored
Mar 07, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update clar to e1990d6
parent
041cd4a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/clar.c
+2
-2
tests/clar.h
+2
-2
No files found.
tests/clar.c
View file @
dd954a37
...
...
@@ -476,12 +476,12 @@ void clar__assert_equal(
else
if
(
!
strcmp
(
"%.*s"
,
fmt
))
{
const
char
*
s1
=
va_arg
(
args
,
const
char
*
);
const
char
*
s2
=
va_arg
(
args
,
const
char
*
);
size_t
len
=
va_arg
(
args
,
size_
t
);
int
len
=
va_arg
(
args
,
in
t
);
is_equal
=
(
!
s1
||
!
s2
)
?
(
s1
==
s2
)
:
!
strncmp
(
s1
,
s2
,
len
);
if
(
!
is_equal
)
{
if
(
s1
&&
s2
)
{
size_
t
pos
;
in
t
pos
;
for
(
pos
=
0
;
s1
[
pos
]
==
s2
[
pos
]
&&
pos
<
len
;
++
pos
)
/* find differing byte offset */
;
p_snprintf
(
buf
,
sizeof
(
buf
),
"'%.*s' != '%.*s' (at byte %d)"
,
...
...
tests/clar.h
View file @
dd954a37
...
...
@@ -60,8 +60,8 @@ void cl_fixture_cleanup(const char *fixture_name);
#define cl_assert_equal_s(s1,s2) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2, 1, "%s", (s1), (s2))
#define cl_assert_equal_s_(s1,s2,note) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2 " (" #note ")", 1, "%s", (s1), (s2))
#define cl_assert_equal_strn(s1,s2,len) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2, 1, "%.*s", (s1), (s2), (
size_
t)(len))
#define cl_assert_equal_strn_(s1,s2,len,note) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2 " (" #note ")", 1, "%.*s", (s1), (s2), (
size_
t)(len))
#define cl_assert_equal_strn(s1,s2,len) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2, 1, "%.*s", (s1), (s2), (
in
t)(len))
#define cl_assert_equal_strn_(s1,s2,len,note) clar__assert_equal(__FILE__,__LINE__,"String mismatch: " #s1 " != " #s2 " (" #note ")", 1, "%.*s", (s1), (s2), (
in
t)(len))
#define cl_assert_equal_i(i1,i2) clar__assert_equal(__FILE__,__LINE__,#i1 " != " #i2, 1, "%d", (int)(i1), (int)(i2))
#define cl_assert_equal_i_(i1,i2,note) clar__assert_equal(__FILE__,__LINE__,#i1 " != " #i2 " (" #note ")", 1, "%d", (i1), (i2))
...
...
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