#!/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"
cat "${DIRNAME}"/frame_test_pal.mp4/000204.${FILEEXT} > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/000004.${FILEEXT} > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/000104.${FILEEXT} > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/000207.${FILEEXT} > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/000007.${FILEEXT} > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/000107.${FILEEXT} > /dev/null
echo "Access OK"

echo "Checking access with regular expression"
cat "${DIRNAME}"/frame_test_pal.mp4/00020[4-7].* > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/00000[4-7].* > /dev/null
cat "${DIRNAME}"/frame_test_pal.mp4/00010[4-7].* > /dev/null
echo "Access OK"

echo "Pass"

echo "OK"
