CTC++ Coverage Report- Execution Profile#4/7

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Index | No Index


Source file:f:\ctcwork\Demos\cube\mainfrm.cpp
Instrumentation mode:multiconditionReduced to:MC/DC coverage
TER:59 % (24/41) structural,56 % (22/39) statement

Hits/TrueFalseLineSource
1// mainfrm.cpp : implementation of the CMainFrame class
2//
3// This is a part of the Microsoft Foundation Classes C++ library.
4// Copyright (c) Microsoft Corporation.  All rights reserved.
5//
6// This source code is only intended as a supplement to the
7// Microsoft Foundation Classes Reference and related
8// electronic documentation provided with the library.
9// See these sources for detailed information regarding the
10// Microsoft Foundation Classes product.
11
12#include "stdafx.h"
13#include "cube.h"
14
15#include "cubedoc.h"
16#include "cubeview.h"
17#include "mainfrm.h"
18
19#ifdef _DEBUG
20#undef THIS_FILE
21static char BASED_CODE THIS_FILE[] = __FILE__;
22#endif
23
24/////////////////////////////////////////////////////////////////////////////
25// CMainFrame
26
Top
427IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
427  return new CMainFrame
27}
Top
3427FUNCTION CMainFrame::_GetBaseClass()
3427  return ( CFrameWnd::GetThisClass ( ) )
27}
Top
427FUNCTION CMainFrame::GetThisClass()
427  return ( ( CRuntimeClass * ) ( & CMainFrame::classCMainFrame ) )
27}
Top
1097327FUNCTION CMainFrame::GetRuntimeClass()
1097327  return ( ( CRuntimeClass * ) ( & CMainFrame::classCMainFrame ) )
27}
28
Top
915729BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
915729  return GetThisMessageMap ( )
29}
Top
915729FUNCTION CMainFrame::GetThisMessageMap()
30   //{{AFX_MSG_MAP(CMainFrame)
31   ON_WM_CREATE()
32   ON_WM_PALETTECHANGED()
33   ON_WM_QUERYNEWPALETTE()
34   //}}AFX_MSG_MAP
915735END_MESSAGE_MAP()
35}
36
37/////////////////////////////////////////////////////////////////////////////
38// arrays of IDs used to initialize control bars
39
40// toolbar buttons - IDs are command buttons
41static UINT BASED_CODE buttons[] =
42{
43   // same order as in the bitmap 'toolbar.bmp'
44   ID_FILE_PLAY,
45   ID_APP_ABOUT,
46};
47
48/////////////////////////////////////////////////////////////////////////////
49// CMainFrame construction/destruction
50
Top
451CMainFrame::CMainFrame()
52{
53   // TODO: add member initialization code here
54
455}
56
Top
457CMainFrame::~CMainFrame()
58{
459}
60
Top
461int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
62{
0463   if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
064      return -1;
65
66   if (!m_wndToolBar.Create(this) ||
67      !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
68      !m_wndToolBar.SetButtons(buttons,
0469        sizeof(buttons)/sizeof(UINT)))
069    1: T || _ || _
069    2: F || T || _
069    3: F || F || T
469    4: F || F || F
-69    MC/DC (cond 1): 1 - 4
-69    MC/DC (cond 2): 2 - 4
-69    MC/DC (cond 3): 3 - 4
70   {
71      TRACE0("Failed to create toolbar\n");
072      return -1;      // fail to create
73   }
74
75   // TODO: Delete these three lines if you don't want the toolbar to
76   //  be dockable
77   m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
78   EnableDocking(CBRS_ALIGN_ANY);
79   DockControlBar(&m_wndToolBar);
80
81   // TODO: Remove this if you don't want tool tips
82   m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
83      CBRS_TOOLTIPS | CBRS_FLYBY);
84
485   return 0;
86}
87
88/////////////////////////////////////////////////////////////////////////////
89// CMainFrame diagnostics
90
91#ifdef _DEBUG
Top
1094292void CMainFrame::AssertValid() const
93{
94   CFrameWnd::AssertValid();
1094295}
96
Top
097void CMainFrame::Dump(CDumpContext& dc) const
98{
99   CFrameWnd::Dump(dc);
0100}
101
102#endif //_DEBUG
103
104/////////////////////////////////////////////////////////////////////////////
105// CMainFrame message handlers
106
Top
0107void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd)
108{
109   CFrameWnd::OnPaletteChanged(pFocusWnd);
110
00111   if(pFocusWnd != this)
112      OnQueryNewPalette();
0113}
114
Top
0115BOOL CMainFrame::OnQueryNewPalette()
116{
117   int        i;
118   CPalette    *pOldPal;
119   CCubeView   *pView = (CCubeView *)GetActiveView();
120   CClientDC   dc(pView);
121
122
123   pOldPal = dc.SelectPalette(&pView->m_cPalette, FALSE);
124   i = dc.RealizePalette();
125   dc.SelectPalette(pOldPal, FALSE);
126
00127   if(i > 0)
128      InvalidateRect(NULL);
129
130
0131   return CFrameWnd::OnQueryNewPalette();
132}
133
Top
8134BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
135{
136   // remove this flag to remove " - Untitled" from the frame's caption
137
138   cs.style &= ~ FWS_ADDTOTITLE;
139
8140   return CFrameWnd::PreCreateWindow(cs);
141}
***TER59 % (24/41) of FILE mainfrm.cpp
56 % (22/39) statement

Directory Summary | Files Summary | Functions Summary | Untested Code | Execution Profile
To files: First | Previous | Next | Last | Top | Index | No Index