File: test_shuffle

package info (click to toggle)
disorderfs 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 224 kB
  • sloc: cpp: 478; sh: 156; makefile: 64
file content (21 lines) | stat: -rwxr-xr-x 409 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

. ./common

Expect_num_variations () {
	Mount ${1}

	N="$(for X in $(seq 500); do Get_entries; echo; done | sort -u | wc -l)"

	if test ${N} ${2}
	then
		Fail "${1} ${3} (saw ${N} variations)"
	fi
	Unmount
}

Expect_num_variations --shuffle-dirents=yes "= 1" \
	"should always return the same result"

Expect_num_variations --shuffle-dirents=no "!= 1" \
	"should not always return the same result"