Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QTestTable Class Reference

#include <qtesttable_p.h>

Public Functions

void addColumn (int elementType, const char *elementName)
 
int dataCount () const
 
const char * dataTag (int index) const
 
int elementCount () const
 
int elementTypeId (int index) const
 
int indexOf (const char *elementName) const
 
bool isEmpty () const
 
QTestDatanewData (const char *tag)
 
 QTestTable ()
 
QTestDatatestData (int index) const
 
 ~QTestTable ()
 

Static Public Functions

static void clearGlobalTestTable ()
 
static QTestTablecurrentTestTable ()
 
static QTestTableglobalTestTable ()
 

Properties

QTestTablePrivated
 

Detailed Description

Definition at line 63 of file qtesttable_p.h.

Constructors and Destructors

◆ QTestTable()

QTestTable::QTestTable ( )

Definition at line 200 of file qtesttable.cpp.

201 {
202  d = new QTestTablePrivate;
204 }
static QTestTable * currentTestTable
Definition: qtesttable.cpp:82
QTestTablePrivate * d
Definition: qtesttable_p.h:88

◆ ~QTestTable()

QTestTable::~QTestTable ( )

Definition at line 206 of file qtesttable.cpp.

207 {
209  delete d;
210 }
static QTestTable * currentTestTable
Definition: qtesttable.cpp:82
QTestTablePrivate * d
Definition: qtesttable_p.h:88

Functions

◆ addColumn()

void QTestTable::addColumn ( int  elementType,
const char *  elementName 
)

Definition at line 157 of file qtesttable.cpp.

Referenced by QTest::addColumnInternal().

158 {
161 
162  d->append(type, name);
163 }
int type
Definition: qmetatype.cpp:239
void append(int elemType, const char *elemName)
Definition: qtesttable.cpp:128
const char * name
QTestTablePrivate * d
Definition: qtesttable_p.h:88
#define QTEST_ASSERT(cond)
Definition: qtestassert.h:53

◆ clearGlobalTestTable()

void QTestTable::clearGlobalTestTable ( )
static

Definition at line 255 of file qtesttable.cpp.

Referenced by QTest::qInvokeTestMethods().

256 {
259 }
static QTestTable * gTable
Definition: qtesttable.cpp:83

◆ currentTestTable()

QTestTable * QTestTable::currentTestTable ( )
static

Definition at line 261 of file qtesttable.cpp.

Referenced by QTest::addColumnInternal(), and QTest::newRow().

262 {
264 }
static QTestTable * currentTestTable
Definition: qtesttable.cpp:82

◆ dataCount()

int QTestTable::dataCount ( ) const

Definition at line 177 of file qtesttable.cpp.

Referenced by QTest::qInvokeTestMethod(), and QTest::qPrintDataTags().

178 {
180  int count = 0;
181  while (item) {
182  ++count;
183  item = item->next;
184  }
185  return count;
186 }
DataList * dataList
Definition: qtesttable.cpp:75
QTestTablePrivate * d
Definition: qtesttable_p.h:88

◆ dataTag()

const char * QTestTable::dataTag ( int  index) const

Definition at line 220 of file qtesttable.cpp.

221 {
223  if (!item)
224  return 0;
225  return item->elementName;
226 }
QTestTablePrivate * d
Definition: qtesttable_p.h:88
ElementList * elementAt(int index)
Definition: qtesttable.cpp:89
quint16 index

◆ elementCount()

int QTestTable::elementCount ( ) const

Definition at line 165 of file qtesttable.cpp.

Referenced by QTestData::data(), and QTestData::QTestData().

166 {
168  int count = 0;
169  while (item) {
170  ++count;
171  item = item->next;
172  }
173  return count;
174 }
QTestTablePrivate * d
Definition: qtesttable_p.h:88
ElementList * list
Definition: qtesttable.cpp:74

◆ elementTypeId()

int QTestTable::elementTypeId ( int  index) const

Definition at line 212 of file qtesttable.cpp.

Referenced by QTest::fetchData(), and QTest::qElementData().

213 {
215  if (!item)
216  return -1;
217  return item->elementType;
218 }
QTestTablePrivate * d
Definition: qtesttable_p.h:88
ElementList * elementAt(int index)
Definition: qtesttable.cpp:89
quint16 index

◆ globalTestTable()

QTestTable * QTestTable::globalTestTable ( )
static

Definition at line 248 of file qtesttable.cpp.

Referenced by QTest::qInvokeTestMethod(), QTest::qInvokeTestMethods(), and QTest::qPrintDataTags().

249 {
253 }
static QTestTable * gTable
Definition: qtesttable.cpp:83

◆ indexOf()

int QTestTable::indexOf ( const char *  elementName) const

Definition at line 233 of file qtesttable.cpp.

Referenced by QTest::fetchData(), and QTest::qElementData().

234 {
235  QTEST_ASSERT(elementName);
236 
238  int i = 0;
239  while (item) {
240  if (strcmp(elementName, item->elementName) == 0)
241  return i;
242  item = item->next;
243  ++i;
244  }
245  return -1;
246 }
QTestTablePrivate * d
Definition: qtesttable_p.h:88
ElementList * list
Definition: qtesttable.cpp:74
#define QTEST_ASSERT(cond)
Definition: qtestassert.h:53

◆ isEmpty()

bool QTestTable::isEmpty ( ) const

Definition at line 188 of file qtesttable.cpp.

Referenced by QTest::qInvokeTestMethod().

189 {
190  return !d->list;
191 }
QTestTablePrivate * d
Definition: qtesttable_p.h:88
ElementList * list
Definition: qtesttable.cpp:74

◆ newData()

QTestData * QTestTable::newData ( const char *  tag)

Definition at line 193 of file qtesttable.cpp.

Referenced by QTest::newRow().

194 {
195  QTestData *dt = new QTestData(tag, this);
196  d->append(dt);
197  return dt;
198 }
void append(int elemType, const char *elemName)
Definition: qtesttable.cpp:128
QTestTablePrivate * d
Definition: qtesttable_p.h:88

◆ testData()

QTestData * QTestTable::testData ( int  index) const

Definition at line 228 of file qtesttable.cpp.

Referenced by QTest::qInvokeTestMethod(), and QTest::qPrintDataTags().

229 {
230  return d->dataAt(index);
231 }
QTestData * dataAt(int index)
Definition: qtesttable.cpp:100
QTestTablePrivate * d
Definition: qtesttable_p.h:88
quint16 index

Properties

◆ d

QTestTablePrivate* QTestTable::d
private

Definition at line 88 of file qtesttable_p.h.


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