首页 测试 体会 查看内容

压力测试参数化—唯一编号取值

2014-6-25 14:31| 发布者: tianzc| 查看: 606| 评论: 0

摘要: int myfile_w,myfile_r1,myfile_r2;char *file_w="F:testw.txt";char *file_r1="F:testr1.txt";char *file_r2="F:testr2.txt";long text;char booking_no="wjn";char *num_no=lr_eval_string("{unit_no}");char ccl_ ...
int myfile_w,myfile_r1,myfile_r2;char *file_w="F:testw.txt";char *file_r1="F:testr1.txt";char *file_r2="F:testr2.txt";long  text[1024];char booking_no[30]="wjn";char  *num_no=lr_eval_string("{unit_no}");char ccl_file[1024]="TARGET_PATH=/ccl/send/";lr_output_message("num_no: %s",num_no);//打印输出 num_no 的值strcat(booking_no,num_no);lr_output_message("booking_no: %s",booking_no); //打印输出 booking_no 的值//文件 操作 步骤1-读取file_r1内容全新覆盖/写入file_w;  步骤2-将booking_no追加到file_w;myfile_r1=fopen(file_r1,"r");myfile_w=fopen(file_w,"w");while(!feof(myfile_r1)){fgets(text,1024,myfile_r1);fputs(text,myfile_w);}fclose(myfile_r1);fclose(myfile_w);myfile_w=fopen(file_w,"a");fprintf(myfile_w,"%s",booking_no);fclose(myfile_w);ftp_logon_ex(&ftp_session,"ftp_logon","URL=ftp://usrname:[email protected]:21",LAST);strcat(ccl_file,booking_no);strcat(ccl_file,".txt");lr_output_message("ccl_f : %s",ccl_file); //打印输出 ccl_file 的值ftp_put_ex(&ftp_session, "Ftp_Put","SOURCE_PATH=F:/test/w.txt",ccl_file, ENDITEM,            LAST);ftp_logout_ex(&ftp_session);return 0;-------  其中:  *num_no=lr_eval_string("{unit_no}");  将 num_no 值进行参数化: unit number , 开始为1, 块大小为1000000 且每次出现发送.  当控制台 并发 3个用户, 此时输出的 ccl_file文件名按 测试目标正确输出, 但 booking_no 却部分出现数据串的现象.  结果如下 :booking_no        ccl_file        说明2582545531        n1        booking_no 预期为 n1n300000002wjn2        wjn2        booking_no 预期为 n2n300000003        n3        booking_no 预期为 n32582545531        n100000001        booking_no 预期为 n100000001n300000002wjn2        n100000002        booking_no 预期为 n100000002n100000003        n100000003        booking_no 预期为 n1000000032582545531        n200000001        booking_no 预期为 n200000001n200000002        n200000002        booking_no 预期为 n200000002n200000003        n200000003        booking_no 预期为 n200000003

鲜花

握手

雷人

路过

鸡蛋

扫一扫关注最新动态

毒镜头:老镜头、摄影器材资料库、老镜头样片、摄影
爱评测 aipingce.com  
返回顶部