Qt 4.8
Public Functions | Properties | List of all members
QTestCoreElement< ElementType > Class Template Reference

#include <qtestcoreelement.h>

Inheritance diagram for QTestCoreElement< ElementType >:
QTestCoreList< ElementType >

Public Functions

void addAttribute (const QTest::AttributeIndex index, const char *value)
 
const QTestElementAttributeattribute (QTest::AttributeIndex index) const
 
const char * attributeName (QTest::AttributeIndex index) const
 
QTestElementAttributeattributes () const
 
const char * attributeValue (QTest::AttributeIndex index) const
 
const char * elementName () const
 
QTest::LogElementType elementType () const
 
 QTestCoreElement (int type=-1)
 
virtual ~QTestCoreElement ()
 
- Public Functions inherited from QTestCoreList< ElementType >
void addToList (ElementType **list)
 
int count (ElementType *list)
 
int count ()
 
ElementType * nextElement ()
 
ElementType * previousElement ()
 
 QTestCoreList ()
 
virtual ~QTestCoreList ()
 

Properties

QTestElementAttributelistOfAttributes
 
QTest::LogElementType type
 

Detailed Description

template<class ElementType>
class QTestCoreElement< ElementType >

Definition at line 55 of file qtestcoreelement.h.

Constructors and Destructors

◆ QTestCoreElement()

template<class ElementType >
QTestCoreElement< ElementType >::QTestCoreElement ( int  type = -1)

Definition at line 76 of file qtestcoreelement.h.

78 {
79 }
LogElementType
The enum specifies the kinds of test log messages.
QTest::LogElementType type
QTestElementAttribute * listOfAttributes

◆ ~QTestCoreElement()

template<class ElementType >
QTestCoreElement< ElementType >::~QTestCoreElement ( )
virtual

Definition at line 82 of file qtestcoreelement.h.

83 {
84  delete listOfAttributes;
85 }
QTestElementAttribute * listOfAttributes

Functions

◆ addAttribute()

template<class ElementType >
void QTestCoreElement< ElementType >::addAttribute ( const QTest::AttributeIndex  index,
const char *  value 
)

Definition at line 88 of file qtestcoreelement.h.

Referenced by QTestLogger::addBenchmarkResult(), QTestLogger::addIncident(), QTestLogger::addMessage(), QTestLogger::addTag(), QTestLogger::enterTestFunction(), and QTestLogger::stopLogging().

89 {
90  if(attributeIndex == -1)
91  return;
92 
93  if (attribute(attributeIndex))
94  return;
95 
96  QTestElementAttribute *testAttribute = new QTestElementAttribute;
97  testAttribute->setPair(attributeIndex, value);
98  testAttribute->addToList(&listOfAttributes);
99 }
bool setPair(QTest::AttributeIndex attributeIndex, const char *value)
const QTestElementAttribute * attribute(QTest::AttributeIndex index) const
void addToList(T **list)
Definition: qtestcorelist.h:93
QTestElementAttribute * listOfAttributes

◆ attribute()

template<class ElementType >
const QTestElementAttribute * QTestCoreElement< ElementType >::attribute ( QTest::AttributeIndex  index) const

◆ attributeName()

template<class ElementType >
const char * QTestCoreElement< ElementType >::attributeName ( QTest::AttributeIndex  index) const

Definition at line 118 of file qtestcoreelement.h.

Referenced by QTestLightXmlStreamer::formatBeforeAttributes(), QTestXmlStreamer::formatStart(), and QTestLightXmlStreamer::formatStart().

119 {
120  const QTestElementAttribute *attrb = attribute(index);
121  if(attrb)
122  return attrb->name();
123 
124  return 0;
125 }
const QTestElementAttribute * attribute(QTest::AttributeIndex index) const
quint16 index

◆ attributes()

template<class ElementType >
QTestElementAttribute * QTestCoreElement< ElementType >::attributes ( ) const

Definition at line 102 of file qtestcoreelement.h.

Referenced by QTestXunitStreamer::outputElements(), and QTestBasicStreamer::outputElements().

103 {
104  return listOfAttributes;
105 }
QTestElementAttribute * listOfAttributes

◆ attributeValue()

template<class ElementType >
const char * QTestCoreElement< ElementType >::attributeValue ( QTest::AttributeIndex  index) const

Definition at line 108 of file qtestcoreelement.h.

Referenced by QTestLightXmlStreamer::formatBeforeAttributes(), QTestXmlStreamer::formatStart(), and QTestLightXmlStreamer::formatStart().

109 {
110  const QTestElementAttribute *attrb = attribute(index);
111  if(attrb)
112  return attrb->value();
113 
114  return 0;
115 }
const char * value() const
const QTestElementAttribute * attribute(QTest::AttributeIndex index) const
quint16 index

◆ elementName()

template<class ElementType >
const char * QTestCoreElement< ElementType >::elementName ( ) const

Definition at line 128 of file qtestcoreelement.h.

Referenced by QTestXunitStreamer::formatEnd(), and QTestXunitStreamer::formatStart().

129 {
130  const char *xmlElementNames[] =
131  {
132  "property",
133  "properties",
134  "failure",
135  "error",
136  "testcase",
137  "testsuite",
138  "benchmark",
139  "system-err"
140  };
141 
143  return xmlElementNames[type];
144 
145  return 0;
146 }
QTest::LogElementType type

◆ elementType()

template<class ElementType >
QTest::LogElementType QTestCoreElement< ElementType >::elementType ( ) const

Properties

◆ listOfAttributes

template<class ElementType>
QTestElementAttribute* QTestCoreElement< ElementType >::listOfAttributes
private

◆ type

template<class ElementType>
QTest::LogElementType QTestCoreElement< ElementType >::type
private

The documentation for this class was generated from the following file: