??дCppUnit????????
???????????? ???????[ 2013/10/12 17:12:05 ] ????????
????3??????GUI??????MFC???????
????????????????????ó???
????Step1: ????????????????InitInstance()?????????′???
/* CdialogCppUnitDlgdlg;
m_pMainWnd =&dlg;
INT_PTRnResponse = dlg.DoModal();
if (nResponse== IDOK)
{
// TODO: ?????????????
// “???”?????????????
}
else if (nResponse== IDCANCEL)
{
// TODO: ?????????????
// “???”?????????????
}
*/
|
??????д?????????
CppUnit::MfcUi::TestRunner runner;
runner.addTest(PlusTest::suite());//??????
runner.run();//showui
|
????Step2:??д?????????????????£?
PlusTestCase.h
#pragma once
#include "cppunit/TestCase.h"
#include "cppunit/extensions/HelperMacros.h"
class CPlusTestCase :public CppUnit::TestCase
{
//???????TestSuite
CPPUNIT_TEST_SUITE(CPlusTestCase);
//????????????TestSuite???????μ????????????????????????
//CPPUNIT_TEST(testSort);
CPPUNIT_TEST(testAdd);
//TestSuite???????
CPPUNIT_TEST_SUITE_END();
public:
CPlusTestCase(void);
~CPlusTestCase(void);
voidtestAdd();//???????
//voidtestSort();//??????????
void setUp();
voidtearDown();
};
PlusTestCase.cpp
#include "StdAfx.h"
#include "PlusTestCase.h"
#include "../dllMfcDlg/CPlus.h" //20130327
//#include "../intSort/CCSort.h" //20130327
#pragma comment (lib?? "cppunitd_dll.lib")
#pragma comment(lib??"E:\workStudyDocu\CppUnit\2008cppunit-lib-dll_32\testrunnerud.lib")
#pragma comment (lib??"E:\workStudyDocu\CppUnit\2008cppunit-lib-dll_32\cppunitd.lib")
//#pragma comment(lib??"E:\workStudyDocu\CppUnit\2008cppunit-lib-dll_32\testrunnerd.lib")
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(CPlusTestCase??"plus");//?????????plus??TestSuite
//CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(CPlusTestCase??"sort");
CPlusTestCase::CPlusTestCase(void)
{
}
CPlusTestCase::~CPlusTestCase(void)
{
}
void CPlusTestCase::testAdd()
{
CCPlusplus;//??????????
int nret =plus.Add(10??20);
CPPUNIT_ASSERT_EQUAL(30??nret);
}
void CPlusTestCase::setUp()
{
}
void CPlusTestCase::tearDown()
{
}
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????