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
f83c19c8
Commit
f83c19c8
authored
Jan 30, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2832 from ethomson/appveyor_badge
64-bit Appveyor Builds
parents
6e5a397c
7c48508b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
7 deletions
+43
-7
appveyor.yml
+7
-1
tests/core/structinit.c
+36
-6
No files found.
appveyor.yml
View file @
f83c19c8
...
...
@@ -2,6 +2,12 @@ version: '{build}'
branches
:
only
:
-
master
environment
:
matrix
:
-
GENERATOR
:
"
Visual
Studio
11"
ARCH
:
32
-
GENERATOR
:
"
Visual
Studio
11
Win64"
ARCH
:
64
build_script
:
-
ps
:
>-
choco install cmake
...
...
@@ -12,7 +18,7 @@ build_script:
cd build
cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON
-D STDCALL=ON .. -G"Visual Studio 11
"
cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON
.. -G"$env:GENERATOR
"
cmake --build . --config RelWithDebInfo
test_script
:
...
...
tests/
structinit
/structinit.c
→
tests/
core
/structinit.c
View file @
f83c19c8
...
...
@@ -24,12 +24,10 @@ do { \
structname structname##_macro_latest = macroinit; \
structname structname##_func_latest; \
int structname##_curr_ver = structver - 1; \
memset(&structname##_func_latest, 0, sizeof(structname##_func_latest)); \
cl_git_pass(funcinitname(&structname##_func_latest, structver)); \
cl_check_( \
memcmp(&structname##_macro_latest, &structname##_func_latest, \
sizeof(structname)) == 0, \
"Macro-based and function-based initializer for " STRINGIFY(structname) \
" are not equivalent."); \
options_cmp(&structname##_macro_latest, &structname##_func_latest, \
sizeof(structname), STRINGIFY(structname)); \
\
while (structname##_curr_ver > 0) \
{ \
...
...
@@ -39,8 +37,40 @@ do { \
}\
} while(0)
void
test_structinit_structinit__compare
(
void
)
static
void
options_cmp
(
void
*
one
,
void
*
two
,
size_t
size
,
const
char
*
name
)
{
size_t
i
;
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(((
char
*
)
one
)[
i
]
!=
((
char
*
)
two
)[
i
])
{
char
desc
[
1024
];
p_snprintf
(
desc
,
1024
,
"Difference in %s at byte %d: macro=%u / func=%u"
,
name
,
i
,
((
char
*
)
one
)[
i
],
((
char
*
)
two
)[
i
]);
clar__fail
(
__FILE__
,
__LINE__
,
"Difference between macro and function options initializer"
,
desc
,
0
);
return
;
}
}
}
void
test_core_structinit__compare
(
void
)
{
/* These tests assume that they can memcmp() two structures that were
* initialized with the same static initializer. Eg,
* git_blame_options = GIT_BLAME_OPTIONS_INIT;
*
* This assumption fails when there is padding between structure members,
* which is not guaranteed to be initialized to anything sane at all.
*
* Assume most compilers, in a debug build, will clear that memory for
* us or set it to sentinal markers. Etc.
*/
#if !defined(DEBUG) && !defined(_DEBUG)
clar__skip
();
#endif
/* blame */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_blame_options
,
GIT_BLAME_OPTIONS_VERSION
,
\
...
...
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