Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
770f643e
Commit
770f643e
authored
10 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #11259 from owncloud/fix-windows-max-depth-test
fixing windows max depth test
parents
6c1871da
6de8531a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/files/view.php
+19
-6
19 additions, 6 deletions
tests/lib/files/view.php
with
19 additions
and
6 deletions
tests/lib/files/view.php
+
19
−
6
View file @
770f643e
...
...
@@ -588,19 +588,32 @@ class View extends \PHPUnit_Framework_TestCase {
$rootView
=
new
\OC\Files\View
(
''
);
$longPath
=
''
;
// 4000 is the maximum path length in file_cache.path
$ds
=
DIRECTORY_SEPARATOR
;
/*
* 4096 is the maximum path length in file_cache.path in *nix
* 1024 is the max path length in mac
* 228 is the max path length in windows
*/
$folderName
=
'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789'
;
$depth
=
(
4000
/
57
);
$tmpdirLength
=
strlen
(
\OC_Helper
::
tmpFolder
());
if
(
\OC_Util
::
runningOnWindows
())
{
$this
->
markTestSkipped
();
$depth
=
((
260
-
$tmpdirLength
)
/
57
);
}
elseif
(
\OC_Util
::
runningOnMac
()){
$depth
=
((
1024
-
$tmpdirLength
)
/
57
);
}
else
{
$depth
=
((
4000
-
$tmpdirLength
)
/
57
);
}
foreach
(
range
(
0
,
$depth
-
1
)
as
$i
)
{
$longPath
.
=
'/'
.
$folderName
;
$longPath
.
=
$ds
.
$folderName
;
$result
=
$rootView
->
mkdir
(
$longPath
);
$this
->
assertTrue
(
$result
,
"mkdir failed on
$i
- path length: "
.
strlen
(
$longPath
));
$result
=
$rootView
->
file_put_contents
(
$longPath
.
'/
test.txt
'
,
'lorem'
);
$result
=
$rootView
->
file_put_contents
(
$longPath
.
"
{
$ds
}
test.txt
"
,
'lorem'
);
$this
->
assertEquals
(
5
,
$result
,
"file_put_contents failed on
$i
"
);
$this
->
assertTrue
(
$rootView
->
file_exists
(
$longPath
));
$this
->
assertTrue
(
$rootView
->
file_exists
(
$longPath
.
'/
test.txt
'
));
$this
->
assertTrue
(
$rootView
->
file_exists
(
$longPath
.
"
{
$ds
}
test.txt
"
));
}
$cache
=
$storage
->
getCache
();
...
...
@@ -617,7 +630,7 @@ class View extends \PHPUnit_Framework_TestCase {
$this
->
assertTrue
(
is_array
(
$cachedFile
),
"No cache entry for file at
$i
"
);
$this
->
assertEquals
(
'test.txt'
,
$cachedFile
[
'name'
],
"Wrong cache entry for file at
$i
"
);
$longPath
.
=
'/'
.
$folderName
;
$longPath
.
=
$ds
.
$folderName
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment