2008年8月10日日曜日

calc_priceモジュール TESTコード

モジュールを作ったらTESTせねばってことでTEST

関数cmp_priceのTEST
 #include "longint.hsp"
#include "FILE_calc_price_slv_0_3.hsp"
init_calc_price
logmes "cmp:LV1:0:50"
logmes str(cmp_price(1,0,50))
logmes "cmp:LV1:0:49"
logmes str(cmp_price(1,0,49))
logmes "cmp:LV16:2:0"
logmes str(cmp_price(16,2,0))
logmes "cmp:LV16:0:0"
logmes str(cmp_price(16,0,0))
stop


命令get_priceのTEST
 #include "longint.hsp"
#include "FILE_calc_price_slv_0_3.hsp"
init_calc_price
repeat 24,1
a=0
b=0
get_price cnt,a,b
logmes str(cnt)+"a:"+a
logmes str(cnt)+"b:"+b
loop
stop


命令sub_priceのTEST
 #include "longint.hsp"
#include "FILE_calc_price_slv_0_3.hsp"
init_calc_price
repeat 24,1
a=0:b=0
sub_price cnt,a,b
logmes str(cnt)+"a:"+str(a)
logmes str(cnt)+"b:"+str(b)
loop
stop


型変換がきちんとなされているか?のTEST
 #include "longint.hsp"
#include "FILE_calc_price_slv_0_3.hsp"
init_calc_price
a=9999999
b=9999999
sub_price 20,a,b
mes ""+a+"M"+b
stop

0 件のコメント: