C++gtest测试单元测试

#include <iostream>
#include <string>
#include "TestFunction.h"
#include <gtest/gtest.h>
using namespace std;
//using ::testing::InitGoogleTest;
using namespace testing;

#pragma comment(lib, "gtestd.lib")


void main(int argc, char **argv)
{
/*cout << "请输入评委人数" << endl;
int total;
cin >> total;
SeekScore(total);


int wait;
cin >> wait;*/


//GTEST_FLAG(output) = "xml:";
//InitGoogleTest(&argc, argv);

////excute all test cases
//
//RUN_ALL_TESTS();


char *pString = "ganquanfu2008";
int size = strlen(pString) + 1;
char *pNewString = new char[size];
memcpy(pNewString,pString,size);
cout << pNewString << endl;
int wait;
cin >> wait;
}

TEST(SeekScoreTest,thousand)
{
EXPECT_EQ(499.5, SeekScore(100));
}

posted @ 2013-07-06 12:40  Predator  阅读(486)  评论(0编辑  收藏  举报