软件测试
一般软件或程序写完后,需要进行测试,一般有两种,白盒子和黑盒子测试在网上找了很久,没有找到写测试数据程序,于是自己写了个,在linux下。
被测试程序:class Test
{
public:
int x;
static int y;
Test(int data=0){x=data;}
~Test(){};
void function(){x++;y++}
};
int Test::y=0;
void main()
{
Test one;
Test two;
Test three;
one.function();
cout<<”x=”<
<two.function();
cout<<”x=”<<three.function();
cout<<”x=”<<}
被测试数据:
#include
#include
using namespace std;
ofstream out("1.txt");
int main(int argc, char * argv[])
{
for (int i = 1; i < 10000; i++) {
out << i << " "
<< i + 1 << " "
<< i + 2 << " "
<< endl;
}
}
测试程序(bash shell):
# !/bin/sh
# 8.sh
cat 1.txt | while read oneline
do
echo ------------------------------------------
./a.out <$oneline
EOF
done
阅读(213) | 评论(0) | 转发(0) |