I am attempting insert CppUnit test suite directly to my MFC windows application.
With TextTestRunner is not any problem.
But when I try use MfcTestRunner it assert in run() function:
part of source code is:
void CMyWinApp::OnUnitTest()
{
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
pFrame->m_pMsgWait->ShowInfo(MAKESTRING(IDS_INFO3009));
// declare a test runner, fill it with our registered tests and run them
CppUnit::MfcTestRunner runner;
runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
runner.run();
...
Please, can anybody tell me, where can be problem and if using of MfcTestRunner is possible directly in tested CWinApp?
Thanks for ansfer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am attempting insert CppUnit test suite directly to my MFC windows application.
With TextTestRunner is not any problem.
But when I try use MfcTestRunner it assert in run() function:
bool cdxCDynamicWndEx::RestoreWindowPosition(LPCTSTR lpszProfile,
const CString &entryPrefix,
UINT restoreFlags)
{
if(!IsWindow() || !lpszProfile || !*lpszProfile)
{
ASSERT(false);
return false;
}
CWnd *pWnd = Window();
CWinApp *app = AfxGetApp();
if(!app->m_pszRegistryKey || !*app->m_pszRegistryKey)
part of source code is:
void CMyWinApp::OnUnitTest()
{
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
pFrame->m_pMsgWait->ShowInfo(MAKESTRING(IDS_INFO3009));
// declare a test runner, fill it with our registered tests and run them
CppUnit::MfcTestRunner runner;
runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
runner.run();
...
Please, can anybody tell me, where can be problem and if using of MfcTestRunner is possible directly in tested CWinApp?
Thanks for ansfer.
(assertion:
CWinApp *app =AfxGetApp(); returns 0x00000000 value)