Chinaunix首页 | 论坛 | 博客
  • 博客访问: 46579
  • 博文数量: 43
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 495
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-19 14:06
文章分类

全部博文(43)

文章存档

2011年(1)

2009年(42)

我的朋友
最近访客

分类: C/C++

2009-07-31 21:43:56

软件测试
      一般软件或程序写完后,需要进行测试,一般有两种,白盒子和黑盒子测试在网上找了很久,没有找到写测试数据程序,于是自己写了个,在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) |
0

上一篇:Tcp连接

下一篇:c++的异常机制

给主人留下些什么吧!~~