Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TestCaseWithEvtCheck Class Reference
[Test Case Support]

#include <TestCaseWithEvtCheck.h>

Inheritance diagram for TestCaseWithEvtCheck:

TestCaseGenericSetUp TestCase TestCaseBasicReconfigurer_1 TestCaseControlList_1 TestCaseCyclingPunctualActionModeManager_1 TestCaseCyclingTelemetryModeManager_1 TestCaseDataPoolMonitor_1 TestCaseDummyCopyControlBlock_1 TestCaseDummyCriticalTelecommand_2 TestCaseDummyDataItemControlBlock_1 TestCaseDummyDataPoolControlBlock_1 TestCaseDummyManoeuvre_1 TestCaseDummyModeManager_1 TestCaseDummyPointerControlBlock_1 TestCaseDummyPunctualAction_1 TestCaseFSM_1 TestCaseIntStack_1 TestCaseManoeuvreManager_1 TestCaseManoeuvreManager_2 TestCaseManoeuvreManager_3 TestCaseProfileList_1 TestCasePUSDataReportingPacket_1 TestCasePUSDataReportingPacket_2 TestCasePUSDataReportingPacket_3 TestCasePUSMemoryDumpOffset_1 TestCasePUSMemoryLoadAbsolute_1 TestCasePUSMemoryLoadOffset_1 TestCasePUSMemoryLoadOffset_2 TestCaseRootObjectStack_1 TestCaseSampleFullDataPool_1 TestCaseSampleMonitoredDataPool_1 TestCaseSampleR1Database_1 TestCaseSampleR2Database_1 TestCaseSampleR3Database_1 TestCaseTelemetryManager_2 TestCaseTestPUSConfigurableManoeuvre_1 TestCaseWithFactories List of all members.

Detailed Description

Base class for test cases that need to perform checks on the event repository associated to the CC_RootObject class.

Two types of checks are foreseen. The latest event check verifies the type and parameter of the latest event in the repository and the total number of events in the repository. The specific event check verifies the type and parameter of a specific event in the repository.

See also:
CC_RootObject::getEventRepository
Author:
Roberto Totaro
Version:
1.0

Definition at line 35 of file TestCaseWithEvtCheck.h.

Public Member Functions

 TestCaseWithEvtCheck (int testId, char *testName)
 Set the identifier and the name of the test case.

virtual bool setUpTestCase (void)
 Call the test setup service of the super class.


Protected Member Functions

unsigned int getNumberOfEvents (void) const
 Get the current number of events in the repository.

unsigned int getEventRepositorySize (void) const
 Get the size of the event repository (the maximum number of events it can contain).

bool verifyLatestEventHidden (const int line, const unsigned int nEvt, const TD_EventType eventType)
 Perform a latest event check.

bool verifySpecificEventHidden (const int line, const unsigned int n, const TD_EventType eventType)
 Perform a specific event check.


Constructor & Destructor Documentation

TestCaseWithEvtCheck::TestCaseWithEvtCheck int  testId,
char *  testName
 

Set the identifier and the name of the test case.

Parameters:
testId the test identifier
testName the name of the test

Definition at line 22 of file TestCaseWithEvtCheck.cpp.


Member Function Documentation

unsigned int TestCaseWithEvtCheck::getEventRepositorySize void   )  const [protected]
 

Get the size of the event repository (the maximum number of events it can contain).

Returns:
Size of event repository

Definition at line 35 of file TestCaseWithEvtCheck.cpp.

unsigned int TestCaseWithEvtCheck::getNumberOfEvents void   )  const [protected]
 

Get the current number of events in the repository.

Returns:
Number of events

Definition at line 31 of file TestCaseWithEvtCheck.cpp.

bool TestCaseWithEvtCheck::setUpTestCase void   )  [virtual]
 

Call the test setup service of the super class.

Reimplemented from TestCaseGenericSetUp.

Reimplemented in TestCasePUSFull, and TestCaseWithFactories.

Definition at line 27 of file TestCaseWithEvtCheck.cpp.

bool TestCaseWithEvtCheck::verifyLatestEventHidden const int  line,
const unsigned int  nEvt,
const TD_EventType  eventType
[protected]
 

Perform a latest event check.

More specifically, the following tests are performed on the event repository associated to the CC_RootObject class:

  • Verifies that the number of events in the repository is equal to nEvt
  • Checks that the event type of the latest event in the repository is equal to eventType
If all the tests are passed, the method returns true, otherwise false.
Parameters:
line line number
nEvt the expected number of events in the repository
eventType the expected type of the latest event in the repository
Returns:
true if the tests are passed, false otherwise

Definition at line 39 of file TestCaseWithEvtCheck.cpp.

bool TestCaseWithEvtCheck::verifySpecificEventHidden const int  line,
const unsigned int  n,
const TD_EventType  eventType
[protected]
 

Perform a specific event check.

The event to be checked is the n-th event in the buffer. The argument n must lie in the range [N-S+1, N] where N is the total number of events stored in the repository since it was created (return value of method getCounter()) and S is the repository size. If the method argument does not satisfy this constraint, the test returns false. Otherwise, the following checks are performed on the target event:

  • Verify that the event type of the checked event in the repository is equal to eventType
If all the tests are passed, the method returns true, otherwise false.
Parameters:
line line number
n the identifier of the target event
eventType the expected type of the target event
Returns:
true if the tests are passed, false otherwise

Definition at line 64 of file TestCaseWithEvtCheck.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved