mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-09 14:09:17 +00:00
tests: MSVC compat
MSVC doesn't like declaring variables in the middle of a block, so make sure we only declare variables at the beginning of a block.
This commit is contained in:
parent
4a759bfbcf
commit
8e52472037
@ -19,8 +19,10 @@
|
|||||||
* signature "int (structname* instance, int version)".
|
* signature "int (structname* instance, int version)".
|
||||||
*/
|
*/
|
||||||
#define CHECK_MACRO_FUNC_INIT_EQUAL(structname, structver, macroinit, funcinitname) \
|
#define CHECK_MACRO_FUNC_INIT_EQUAL(structname, structver, macroinit, funcinitname) \
|
||||||
|
do { \
|
||||||
structname structname##_macro_latest = macroinit; \
|
structname structname##_macro_latest = macroinit; \
|
||||||
structname structname##_func_latest; \
|
structname structname##_func_latest; \
|
||||||
|
int structname##_curr_ver = structver - 1; \
|
||||||
cl_git_pass(funcinitname(&structname##_func_latest, structver)); \
|
cl_git_pass(funcinitname(&structname##_func_latest, structver)); \
|
||||||
cl_check_( \
|
cl_check_( \
|
||||||
memcmp(&structname##_macro_latest, &structname##_func_latest, \
|
memcmp(&structname##_macro_latest, &structname##_func_latest, \
|
||||||
@ -28,13 +30,13 @@
|
|||||||
"Macro-based and function-based initializer for " STRINGIFY(structname) \
|
"Macro-based and function-based initializer for " STRINGIFY(structname) \
|
||||||
" are not equivalent."); \
|
" are not equivalent."); \
|
||||||
\
|
\
|
||||||
int structname##_curr_ver = structver - 1; \
|
|
||||||
while (structname##_curr_ver > 0) \
|
while (structname##_curr_ver > 0) \
|
||||||
{ \
|
{ \
|
||||||
structname macro; \
|
structname macro; \
|
||||||
cl_git_pass(funcinitname(¯o, structname##_curr_ver)); \
|
cl_git_pass(funcinitname(¯o, structname##_curr_ver)); \
|
||||||
structname##_curr_ver--; \
|
structname##_curr_ver--; \
|
||||||
}
|
}\
|
||||||
|
} while(0)
|
||||||
|
|
||||||
void test_structinit_structinit__compare(void)
|
void test_structinit_structinit__compare(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user