winIDEA SDK
IConnectCoverage Struct Reference

Description

This interface provides access to winIDEA coverage functionality.

#include <i_Connect.h>

Inherits IUnknown.

Public Types

enum  EErrorCode {
  errorOK , errorInternal ,
  errorNotImplemented , errorInvalidParameter ,
  errorInvalidRangeset , errorUnsuportedCoverageType
}
 Defines constants describing test case status. More...
 
enum  EInfoFlags { ifGetCapabilities = 0x00000001 , ifGetType = 0x00000002 }
 The type of information, which can be returned by GetInfo(). More...
 
enum  EInfoCapabilities { icAvailable = 0x00000001 , icBranches = 0x00000002 }
 Describes the coverage capabilities returned by GetInfo(), if dwInfoFlags was set to EInfoFlags::ifGetCapabilities. More...
 
enum  EInfoType { itHardware = 1 , itOffline = 2 }
 Describes the available coverage types returned by GetInfo(), if dwInfoFlags was set to EInfoFlags::ifGetType. More...
 
enum  EConfigFlags {
  cfNOP = 0x00000000 , cfSetConfigScope = 0x00000001 ,
  cfSetConfigLevel = 0x00000002 , cfSetConfigOperation = 0x00000003 ,
  cfAddRangeset = 0x00000004 , cfSetRangesetScope = 0x00000005 ,
  cfAddRangesetExcludeFolder = 0x00000006 , cfAddRangesetExcludeModule = 0x00000007 ,
  cfAddRangesetExcludeFunction = 0x00000008 , cfAddRangesetExcludeItem = 0x00000009 ,
  cfAddRangesetIncludeFolder = 0x0000000A , cfAddRangesetIncludeModule = 0x0000000B ,
  cfAddRangesetIncludeFunction = 0x0000000C , cfAddRangesetIncludeItem = 0x0000000D ,
  cfSetActiveRangeset = 0x0000000E , cfSetActiveRangesetByIndex = 0x0000000F ,
  cfClearConfiguration = 0x00000010
}
 Defines coverage configuration parameters set by function SetConfig(). More...
 
enum  EConfigScope {
  cfgsAllDownloaded = 0x00000001 , cfgsEntireMemory = 0x00000002 ,
  cfgsUseRangeset = 0x00000003
}
 Defines constants, which define coverage scope. More...
 
enum  EConfigLevel { cfglStatementCoverage = 0x00000001 , cfglDecisionCoverage = 0x00000002 }
 Defines coverage level, values may be ORed together. More...
 
enum  EConfigOperation { cfgoAutoStartWithCPU = 0x00000001 , cfgoAutoUpdateOnStop = 0x00000002 }
 Defines constants, which define coverage operation mode. More...
 
enum  ERangesetScope {
  rssAllDownloadedCode = 0x00000001 , rssEntireMemory = 0x00000002 ,
  rssRegions = 0x00000003
}
 Defines available rangeset scopes. More...
 
enum  EActivateFlags {
  afStart = 0x00000001 , afStop = 0x00000002 ,
  afResume = 0x00000003
}
 Defines activation commands used by function Activate(). More...
 
enum  EStatusFlags { sfActivationStatus = 0x00000001 }
 Defines types of status requested by function GetStatus(). More...
 
enum  EActivationStatus { asInactive = 0x00000001 , asActive = 0x00000002 }
 Describes coverage status regarding to activity. More...
 
enum  ECoverageRangesFlags { crfActiveRanges = 0x00000001 , crfResolveRange = 0x00000002 }
 Defines type of range to get by function GetCoverageRanges(). More...
 
enum  ECoverageRangesTypes {
  crtFolder = 1 , crtModule = 2 ,
  crtFunction = 3 , crtItem = 4
}
 Defines available rangeset types. More...
 
enum  ECoverageBitmapFlags {
  cbfBitmap0 = 0x00000000 , cbfBitmap1 = 0x00000001 ,
  cbfBitmapMask = 0x0000000F , cbfDefault = cbfBitmap0
}
 Defines type of bitmap to be returned by method GetCoverageBitmap() More...
 
enum  EBitmap0Data {
  bm0_Executed = 0x01 , bm0_Condition = 0x02 ,
  bm0_ConditionTrue = 0x04 , bm0_ConditionFalse = 0x08 ,
  modeBranch = bm0_Condition , modeBranchTaken = bm0_ConditionTrue ,
  modeBranchNotTaken = bm0_ConditionFalse
}
 Defines coverage result constants. More...
 
enum  ECoverageStatisticsFlags {
  csftBytes = 0x00000001 , csftBytesExec = 0x00000002 ,
  csftConditions = 0x00000003 , csftConditionsExec = 0x00000004 ,
  csftConditionsTrue = 0x00000005 , csftConditionsFalse = 0x00000006 ,
  csftConditionsBoth = 0x00000007 , csftBranches = csftConditions ,
  csftBranchesExec = csftConditionsExec , csftBranchesTaken = csftConditionsTrue ,
  csftBranchesNotTaken = csftConditionsFalse , csftBranchesBoth = csftConditionsBoth ,
  csftCountMin = 0x00000008 , csftCountMax = 0x00000009 ,
  csftLines = 0x0000000A , csftLinesExec = 0x0000000B
}
 Defines which type of statistics to retrieve by method GetCoverageStatistics(). More...
 

Public Member Functions

virtual HRESULT GetLastError (LPCSTR pszFileName, DWORD dwErrorFlags, DWORD *pdwErrorCode, LPSTR pszError, DWORD dwErrorLen) PURE
 Gets the last error code and it's string description. More...
 
virtual HRESULT GetInfo (LPCSTR pszFileName, DWORD dwInfoFlags, DWORD *pdwInfo) PURE
 Gets information about the coverage system. More...
 
virtual HRESULT SetConfig (LPCSTR pszFileName, DWORD dwConfigFlags, LPCSTR pszParameter=NULL, DWORD dwParameter=0) PURE
 This method sets the coverage configuration parameters. More...
 
virtual HRESULT Activate (LPCSTR pszFileName, DWORD dwActivateFlags) PURE
 Changes state of code coverage. More...
 
virtual HRESULT GetStatus (LPCSTR pszFileName, DWORD dwStatusFlags, DWORD *pdwStatus) PURE
 Returns current coverage status. More...
 
virtual HRESULT GetCoverageRanges (LPCSTR pszFileName, DWORD dwRangesFlags, DWORD *pdwRangeCount, SCoverageRange *pRanges, LPCSTR pszParameter=NULL, DWORD dwParameter=0) PURE
 Returns all ranges that were defined by method SetConfig(). More...
 
virtual HRESULT GetCoverageBitmap (LPCSTR pszFileName, DWORD dwCoverageBitmapFlags, ADDRESS aAddress, ADDRESS aEnd, DWORD dwBitmapSize, BYTE *pbyBitmap) PURE
 Returns coverage results as an array of bytes, where each byte contains coverage results. More...
 
virtual HRESULT GetCoverageStatistics (LPCSTR pszFileName, DWORD dwCoverageStatisticsFlags, ADDRESS aAddress, ADDRESS aEnd, DWORD *pdwData) PURE
 This method retrieves coverage statistics results. More...
 

Member Enumeration Documentation

◆ EActivateFlags

Defines activation commands used by function Activate().

Enumerator
afStart 

starts coverage

afStop 

stops coverage

afResume 

resumes stopped coverage

◆ EActivationStatus

Describes coverage status regarding to activity.

Enumerator
asInactive 

coverage is not running

asActive 

coverage is running

◆ EBitmap0Data

Defines coverage result constants.

Enumerator
bm0_Executed 

statement coverage

bm0_Condition 

this address holds a conditional instruction

bm0_ConditionTrue 

instruction's condition on this address evaluated true

bm0_ConditionFalse 

instruction's condition on this address evaluated false

modeBranch 

kept for backwards compatibility

modeBranchTaken 

kept for backwards compatibility

modeBranchNotTaken 

kept for backwards compatibility

◆ EConfigFlags

Defines coverage configuration parameters set by function SetConfig().

Enumerator
cfNOP 

reserved

cfSetConfigScope 

see IConnectCoverage::EConfigScope

cfSetConfigLevel 

see IConnectCoverage::EConfigLevel

cfSetConfigOperation 

see IConnectCoverage::EConfigOperation

cfAddRangeset 

create a new rangeset, name in pszParameter

cfSetRangesetScope 

see IConnectCoverage::ERangesetScope

cfAddRangesetExcludeFolder 

add pszParameter to the list of exclude folders

cfAddRangesetExcludeModule 

add pszParameter to the list of exclude modules

cfAddRangesetExcludeFunction 

add pszParameter to the list of exclude functions

cfAddRangesetExcludeItem 

add pszParameter to the list of exclude items

cfAddRangesetIncludeFolder 

add pszParameter to the list of include folders

cfAddRangesetIncludeModule 

add pszParameter to the list of include modules

cfAddRangesetIncludeFunction 

add pszParameter to the list of include functions

cfAddRangesetIncludeItem 

add pszParameter to the list of include items

cfSetActiveRangeset 

activate the rangeset named pszParameter

cfSetActiveRangesetByIndex 

activate the rangeset number dwParameter

cfClearConfiguration 

clear the configuration

◆ EConfigLevel

Defines coverage level, values may be ORed together.

Enumerator
cfglStatementCoverage 

enable statement coverage

cfglDecisionCoverage 

enable decision coverage

◆ EConfigOperation

Defines constants, which define coverage operation mode.

Enumerator
cfgoAutoStartWithCPU 

start coverage when the CPU starts

cfgoAutoUpdateOnStop 

update on stop

◆ EConfigScope

Defines constants, which define coverage scope.

Enumerator
cfgsAllDownloaded 

include all downloaded code

cfgsEntireMemory 

entire memory

cfgsUseRangeset 

use a rangeset

◆ ECoverageBitmapFlags

Defines type of bitmap to be returned by method GetCoverageBitmap()

Enumerator
cbfBitmap0 

for every location one BYTE is used as result, using EBitmap0Data encoding

cbfBitmap1 

for every location one SBitmap1 object is used as result

cbfBitmapMask 

mask for Bitmap format encoding

cbfDefault 

deprecated, use cbfBitmap0 instead

◆ ECoverageRangesFlags

Defines type of range to get by function GetCoverageRanges().

Enumerator
crfActiveRanges 

active ranges in address related format

crfResolveRange 

ranges of the resolved symbol, pass the symbol type in dwParameter and its name on pszParameter

◆ ECoverageRangesTypes

Defines available rangeset types.

Enumerator
crtFolder 

the provided string argument refers to a folder or folders

crtModule 

the provided string argument refers to a module or modules

crtFunction 

the provided string argument refers to a function or funtions

crtItem 

the provided string argument refers to an item or items

◆ ECoverageStatisticsFlags

Defines which type of statistics to retrieve by method GetCoverageStatistics().

Enumerator
csftBytes 

total number of bytes in the queried range

csftBytesExec 

query the number of executed bytes

csftConditions 

query the number of Conditions

csftConditionsExec 

query the number of executed Conditions

csftConditionsTrue 

query the number of Conditions evaluating true

csftConditionsFalse 

query the number of Conditions evaluating false

csftConditionsBoth 

query the number of Conditions that evaluated both ways

csftBranches 

deprecated, use csftConditions

csftBranchesExec 

deprecated, use csftConditionsExec

csftBranchesTaken 

deprecated, use csftConditionsTrue

csftBranchesNotTaken 

deprecated, use csftConditionsFalse

csftBranchesBoth 

deprecated, use csftConditionsBoth

csftLines 

total number of lines in the queried range

csftLinesExec 

query the number of executed lines

◆ EErrorCode

Defines constants describing test case status.

Enumerator
errorOK 

no error was stored for GetLastError

errorInternal 

internal error

errorNotImplemented 

functionality not implemented

errorInvalidParameter 

a passed parameter is invalid

errorInvalidRangeset 

there is no active rangeset

errorUnsuportedCoverageType 

this coverage type doesn't support this functionality

◆ EInfoCapabilities

Describes the coverage capabilities returned by GetInfo(), if dwInfoFlags was set to EInfoFlags::ifGetCapabilities.

These flags can be ORed.

Enumerator
icAvailable 

coverage is available

icBranches 

branch coverage available

◆ EInfoFlags

The type of information, which can be returned by GetInfo().

Constants are used as dwInfoFlags parameter in GetInfo().

Enumerator
ifGetCapabilities 

Coverage capabilities will be returned - IConnectCoverage::EInfoCapabilities.

ifGetType 

Coverage type will be returned - IConnectCoverage::EInfoType.

◆ EInfoType

Describes the available coverage types returned by GetInfo(), if dwInfoFlags was set to EInfoFlags::ifGetType.

These enum contains values, not bit flags.

Enumerator
itHardware 

hardware coverage

itOffline 

offline coverage

◆ ERangesetScope

Defines available rangeset scopes.

Enumerator
rssAllDownloadedCode 

all downloaded code minus excludes

rssEntireMemory 

all memory minus excludes

rssRegions 

only the include regions

◆ EStatusFlags

Defines types of status requested by function GetStatus().

Enumerator
sfActivationStatus 

requests status described by IConnectCoverage::EActivationStatus

Member Function Documentation

◆ Activate()

virtual HRESULT IConnectCoverage::Activate ( LPCSTR  pszFileName,
DWORD  dwActivateFlags 
)
virtual

Changes state of code coverage.

Parameters
pszFileNamefile name of the code coverage document
dwActivateFlagsactivate command, see IConnectCoverage::EActivateFlags

◆ GetCoverageBitmap()

virtual HRESULT IConnectCoverage::GetCoverageBitmap ( LPCSTR  pszFileName,
DWORD  dwCoverageBitmapFlags,
ADDRESS  aAddress,
ADDRESS  aEnd,
DWORD  dwBitmapSize,
BYTE *  pbyBitmap 
)
virtual

Returns coverage results as an array of bytes, where each byte contains coverage results.

Parameters
pszFileNamefile name of the code coverage document
dwCoverageBitmapFlagssee IConnectCoverage::ECoverageBitmapFlags for supported values
aAddressbeginning of the range queried
aEndend of the range queried, inclusive
dwBitmapSizesize of the bitmap buffer, it should be (aEnd - aAddress + 1) for cbfBitmap0 (aEnd - aAddress + 1) * sizeof(SBitmap1) for cbfBitmap1
pbyBitmappointer to an user allocated buffer that has at least one byte per MAU (aEnd - aAddress + 1 <= dwBitampSize). Each byte of the bitmap has information for a single MAU. See IConnectCoverage::ECoverageMode for information about the bits used.
Parameters
pszFileNamefile name of the code coverage document
dwCoverageBitmapFlagssee IConnectCoverage::ECoverageBitmapFlags for supported values
aAddressbeginning of the range queried
aEndend of the range queried, inclusive
dwBitmapSizesize of the bitmap buffer, it should be (aEnd - aAddress + 1) for cbfBitmap0 (aEnd - aAddress + 1) * sizeof(SBitmap1) for cbfBitmap1
pbyBitmappointer to a buffer to hold the query data

◆ GetCoverageRanges()

virtual HRESULT IConnectCoverage::GetCoverageRanges ( LPCSTR  pszFileName,
DWORD  dwRangesFlags,
DWORD *  pdwRangeCount,
SCoverageRange pRanges,
LPCSTR  pszParameter = NULL,
DWORD  dwParameter = 0 
)
virtual

Returns all ranges that were defined by method SetConfig().

Parameters
pszFileNamefile name of the code coverage document
dwRangesFlagssee IConnectCoverage::ECoverageRangesFlags
pdwRangeCountdefines the number of items in pRanges array
pRangespoints to array of coverage ranges
pszParameterset depending on the value of dwRangesFlags
dwParameterset depending on the value of dwRangesFlags

◆ GetCoverageStatistics()

virtual HRESULT IConnectCoverage::GetCoverageStatistics ( LPCSTR  pszFileName,
DWORD  dwCoverageStatisticsFlags,
ADDRESS  aAddress,
ADDRESS  aEnd,
DWORD *  pdwData 
)
virtual

This method retrieves coverage statistics results.

Parameters
pszFileNamefile name of the code coverage document
dwCoverageStatisticsFlagssee IConnectCoverage::ECoverageStatisticsFlags for supported values
aAddressbeginning of the range queried
aEndend of the range queried, inclusive
pdwDatapointer to a DWORD that will get the query result

◆ GetInfo()

virtual HRESULT IConnectCoverage::GetInfo ( LPCSTR  pszFileName,
DWORD  dwInfoFlags,
DWORD *  pdwInfo 
)
virtual

Gets information about the coverage system.

Parameters
pszFileNamefile name of the code coverage document
dwInfoFlagsDefines requested information, see IConnectCoverage::EInfoFlags
pdwInfoOn return contains information requested by dwInfoFlags, see IConnectCoverage::EInfoCapabilities and IConnectCoverage::EInfoType

◆ GetLastError()

virtual HRESULT IConnectCoverage::GetLastError ( LPCSTR  pszFileName,
DWORD  dwErrorFlags,
DWORD *  pdwErrorCode,
LPSTR  pszError,
DWORD  dwErrorLen 
)
virtual

Gets the last error code and it's string description.

Call this method, when other methods of this interface do not return S_OK, to get detailed error code and description.

Parameters
pszFileNamefile name of the code coverage document
dwErrorFlagsflags that modify the behavior of the function. Should be 0.
pdwErrorCodereturned error code, see IConnectCoverage::EErrorCode
pszErrorbuffer for the error description string
dwErrorLenlength of the error string buffer

◆ GetStatus()

virtual HRESULT IConnectCoverage::GetStatus ( LPCSTR  pszFileName,
DWORD  dwStatusFlags,
DWORD *  pdwStatus 
)
virtual

Returns current coverage status.

Parameters
pszFileNamefile name of the code coverage document
dwStatusFlagsdefines requested status, see IConnectCoverage::EStatusFlags
pdwStatuson return contains coverage status, see IConnectCoverage::EActivationStatus

◆ SetConfig()

virtual HRESULT IConnectCoverage::SetConfig ( LPCSTR  pszFileName,
DWORD  dwConfigFlags,
LPCSTR  pszParameter = NULL,
DWORD  dwParameter = 0 
)
virtual

This method sets the coverage configuration parameters.

Parameters
pszFileNamefile name of the code coverage document
dwConfigFlagsset to one of values defined by IConnectCoverage::EConfigFlags
pszParameterset depending on the value of dwConfigFlags
dwParameterset depending on the value of dwConfigFlags