testall.c

来自「1、编写测试驱动 2、设计相应的黑盒测试用例」· C语言 代码 · 共 39 行

C
39
字号
#include <stdio.h>
#include <stdlib.h>

FILE *itest,*otest;

void test(FILE *itest)
{
	int a, b, x;
	 
	FILE	*ifile,*ofile,*f1;

	x=1;
	
	f1=testdriver1(itest);
	otest=testdriver2(f1);

	while (x)
	{
		a=getc(itest);
		b=getc(otest);
		//比较原始文件和经过编码和解码后的文件是否一致,不一致设x=0。
		if(a<>b)
			x=0;
	}
	
	if x=1
		printf("success!\n");
	else
		printf("fail!\n");
	endif

}






⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?