#!/bin/bash

ADDOPT=""

. "${BASH_SOURCE%/*}/funcs.sh" "$1"

FILES=250

echo "Checking number of files is ${FILES}"
[ $(ls "${DIRNAME}"/frame_test_pal.mp4/ -1 | wc -l) = ${FILES} ]
echo "Number of files OK"

echo "Checking access with full name"
for i in 000204 000004 000104 000207 000007 000107
do
	echo ">> Checking $i.${FILEEXT}"
	cp -v "${DIRNAME}"/frame_test_pal.mp4/$i.${FILEEXT} /dev/null
done
echo "Access OK"

echo "Checking access with regular expression"
for i in 00020[4-7] 00000[4-7] 00010[4-7]
do
	echo ">> Checking $i.*"
	for FILE in "${DIRNAME}"/frame_test_pal.mp4/00020[4-7].*
	do
   		cp -v $FILE /dev/null
	done 2>/dev/null
done
echo "Access OK"

echo "Pass"

echo "OK"
