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
1a1d5758
Commit
1a1d5758
authored
Sep 22, 2015
by
Edward Thomson
Committed by
Carlos Martín Nieto
Nov 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32: test checkout msg on long path err
parent
80b4536b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
tests/win32/longpath.c
+62
-0
No files found.
tests/win32/longpath.c
0 → 100644
View file @
1a1d5758
#include "clar_libgit2.h"
#include "git2/clone.h"
#include "clone.h"
#include "buffer.h"
#include "fileops.h"
static
git_buf
path
=
GIT_BUF_INIT
;
void
test_win32_longpath__initialize
(
void
)
{
#ifdef GIT_WIN32
const
char
*
base
=
clar_sandbox_path
();
size_t
base_len
=
strlen
(
base
);
size_t
remain
=
MAX_PATH
-
base_len
;
size_t
i
;
git_buf_clear
(
&
path
);
git_buf_puts
(
&
path
,
base
);
git_buf_putc
(
&
path
,
'/'
);
cl_assert
(
remain
<
(
MAX_PATH
-
5
));
for
(
i
=
0
;
i
<
(
remain
-
5
);
i
++
)
git_buf_putc
(
&
path
,
'a'
);
printf
(
"%s %"
PRIuZ
"
\n
"
,
path
.
ptr
,
path
.
size
);
#endif
}
void
test_win32_longpath__cleanup
(
void
)
{
git_buf_free
(
&
path
);
}
#ifdef GIT_WIN32
void
assert_name_too_long
(
void
)
{
const
git_error
*
err
;
size_t
expected_len
,
actual_len
;
const
char
*
expected_msg
;
err
=
giterr_last
();
actual_len
=
strlen
(
err
->
message
);
expected_msg
=
git_win32_get_error_message
(
ERROR_FILENAME_EXCED_RANGE
);
expected_len
=
strlen
(
expected_msg
);
/* check the suffix */
cl_assert_equal_s
(
expected_msg
,
err
->
message
+
(
actual_len
-
expected_len
));
}
#endif
void
test_win32_longpath__errmsg_on_checkout
(
void
)
{
#ifdef GIT_WIN32
git_repository
*
repo
;
cl_git_fail
(
git_clone
(
&
repo
,
cl_fixture
(
"testrepo.git"
),
path
.
ptr
,
NULL
));
assert_name_too_long
();
#endif
}
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