diff options
author | Markus Goetz <markus@woboq.com> | 2017-01-20 17:46:04 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-17 00:06:31 -0600 |
commit | 075a6065141e2412454699ca8e7fca558c5b6b4f (patch) | |
tree | 8ea8719d63737ce828b97a1c6c468fb6b2ba5b55 /apps/dav/tests | |
parent | 39afcbd49feb4ba333746762fe7c9d4701db9860 (diff) | |
download | nextcloud-server-075a6065141e2412454699ca8e7fca558c5b6b4f.tar.gz nextcloud-server-075a6065141e2412454699ca8e7fca558c5b6b4f.zip |
Chunking NG: Assemble in natural sort order of files
For https://github.com/owncloud/client/pull/5476
Before this, the assembly could be bogusly in the order 0,1,10,11,2,3 etc.
As per the spec "The name of every chunk should be its chunk number."
https://github.com/cernbox/smashbox/blob/master/protocol/chunking.md
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/Upload/AssemblyStreamTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php index 66aea40ef22..69ee52299e9 100644 --- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php +++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php @@ -52,6 +52,15 @@ class AssemblyStreamTest extends \Test\TestCase { function providesNodes() { $data8k = $this->makeData(8192); $dataLess8k = $this->makeData(8191); + + $tonofnodes = []; + $tonofdata = ""; + for ($i = 0; $i < 101; $i++) { + $thisdata = rand(0,100); // variable length and content + $tonofdata .= $thisdata; + array_push($tonofnodes, $this->buildNode($i,$thisdata)); + } + return[ 'one node zero bytes' => [ '', [ @@ -90,6 +99,9 @@ class AssemblyStreamTest extends \Test\TestCase { $this->buildNode('1', $data8k . 'X'), $this->buildNode('0', $data8k) ]], + 'a ton of nodes' => [ + $tonofdata, $tonofnodes + ] ]; } |