📄 cbkd.t
字号:
# This material contains proprietary software of Entropic Speech, Inc.# Any reproduction, distribution, or publication without the prior# written permission of Entropic Speech, Inc. is strictly prohibited.# Any public distribution of copies of this work authorized in writing by# Entropic Speech, Inc. must bear the notice## "Copyright (c) 1991 Entropic Speech, Inc.; All rights reserved"## makefile for @(#)cbkd.t 1.1 2/22/91 ERL#! /bin/csh ## test script for cbkdset PROG = cbkdsetenv USE_ESPS_COMMON offalias vecho 'if $VERBOSE echo'alias ndrec 'hditem -i ndrec'alias errex 'exit(1)'alias passex 'exit(0)'\rm params >& /dev/null# test script parameters# ----------------------# if test script finds an error, it exits with errex# if program passes the test, test scripts exits with passex# VERBOSE: 0 script works silently# 1 script actual and correct test results are echoedset VERBOSE = 1vecho "$PROG test script: `date`"vecho "construct vq codebook to use for testing"echo "0 0 0 0" > in.ascecho "1 1 1 1" >> in.ascecho "double conv_ratio = 0.0005;" > vqdesasc.pecho "int vq_size = 2;" >> vqdesasc.pecho 'string cbk_struct = "FULL_SEARCH";' >> vqdesasc.pecho 'string dist_type = "MSE";' >> vqdesasc.pvqdesasc -P vqdesasc.p -c ignore in.asc cbk.in >& /dev/nullif ( `ndrec cbk.in` == 2 ) then vecho "test codebook constructed" \rm in.asc vqdesasc.p vqdesaschist vqdesasc.chk >& /dev/nullelse vecho "can't make test codebook" errexendif# test program i/o and -r parameter# ---------------------------------$PROG -r1 cbk.in cbk.out >& /dev/nullset r1 = `ndrec cbk.out`$PROG - cbk.out < cbk.in >& /dev/nullset r2 = `ndrec cbk.out`($PROG cbk.in - > cbk.out) >& /dev/nullset r3 = `ndrec cbk.out`if ( $r1 == 1 && $r2 == 2 && $r3 == 2 ) then vecho "i/o okay."else vecho "output codebooks contain incorrect number of records." errexendif# check that distances are computed correctly# -------------------------------------------vecho "compute codebook distances"$PROG -r2 cbk.in cbk.out >& /dev/nullset d0 = `pplain -f distance_table"[0]" cbk.out`set d1 = `pplain -f distance_table"[1]" cbk.out`set d2 = `pplain -f distance_table"[2]" cbk.out`set d3 = `pplain -f distance_table"[3]" cbk.out`if ( $d0 == 0 && $d1 == 2 && $d2 == 2 && $d3 == 0 ) then vecho "distances computed correctly."else vecho "error computing distances." errexendif# check -t option# ---------------vecho "checking -t option"$PROG -t table -r2 cbk.in cbk.out >& /dev/nullset d0 = `pplain -f table"[0]" cbk.out`set d1 = `pplain -f table"[1]" cbk.out`set d2 = `pplain -f table"[2]" cbk.out`set d3 = `pplain -f table"[3]" cbk.out`if ( $d0 == 0 && $d1 == 2 && $d2 == 2 && $d3 == 0) then vecho "-t option works."else vecho "error testing -t option." errexendif# checking paramter processing# ----------------------------vecho "checking parameter processing"echo "int start = 2;" > test.paramsecho "int nan = 1;" >> test.paramsecho 'string table_field = "table";' >> test.params$PROG -P test.params cbk.in cbk.out >& /dev/nullset r1 = `ndrec cbk.out`set d0 = `pplain -f table"[0]" cbk.out`set d1 = `pplain -f table"[1]" cbk.out`set d2 = `pplain -f table"[2]" cbk.out`set d3 = `pplain -f table"[3]" cbk.out`if ( $r1 == 1 && $d0 == 0 && $d1 == 2 && $d2 == 2 && $d3 == 0) then vecho "parameter processing okay."else vecho "error in parameter processing." errexendif# checking added fields# ---------------------vecho "checking that added fields are copied from input to output"echo "10" > asc.inecho "20" >> asc.inaddfea -f arf -t LONG -s 1 -c "no comment" asc.in cbk.in$PROG cbk.in cbk.out >& /dev/nullset r1 = `ndrec cbk.out`set d0 = `pplain -r 2 -f distance_table"[0]" cbk.out`set d1 = `pplain -r 2 -f distance_table"[1]" cbk.out`set d2 = `pplain -r 2 -f distance_table"[2]" cbk.out`set d3 = `pplain -r 2 -f distance_table"[3]" cbk.out`set d4 = `pplain -r 1 -f arf cbk.out`set d5 = `pplain -r 2 -f arf cbk.out`if ( $r1 == 2 && $d0 == 0 && $d1 == 2 && $d2 == 2 && $d3 == 0 && $d4 == 10 && $d5 == 20 ) then vecho "field copied okay."else vecho "error in copying added field." errexendif# finished test# -------------\rm asc.in test.params cbk.in cbk.out >& /dev/nullvecho "$PROG test script passed: `date`"passex
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -