File: 01-known-values.sh

package info (click to toggle)
scrypt 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,368 kB
  • sloc: ansic: 5,763; sh: 5,504; makefile: 257
file content (29 lines) | stat: -rw-r--r-- 850 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

### Constants
# The scenario command requires a lot of memory, so valgrind is only enabled
# if $USE_VALGRIND > 1.
c_valgrind_min=2
test_output="${s_basename}-stdout.txt"
reference="${scriptdir}/verify-strings/test_scrypt.good"
reference_small="${scriptdir}/verify-strings/test_scrypt_small.good"

### Actual command
scenario_cmd() {
	# Run the binary which tests known input/output strings.
	setup_check "test_scrypt"
	(
		${c_valgrind_cmd} "${bindir}/tests/verify-strings/test_scrypt" \
			"${SMALLMEM:-0}" 1> "${test_output}"
		echo $? > "${c_exitfile}"
	)

	# The generated values should match the known good values.
	setup_check "test_scrypt output against reference"
	if [ "${SMALLMEM:-0}" -gt "0" ]; then
		cmp -s "${test_output}" "${reference_small}"
	else
		cmp -s "${test_output}" "${reference}"
	fi
	echo $? > "${c_exitfile}"
}