DCMTK: OFTestTest Class Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
OFTestTest Class Referenceabstract

A single test case which can be run. More...

## Public Types
enum | E_Flags { }
| Special flags that a test can have. More...
typedef OFList< OFString > | TestResult
| This is the type used for test results.

## Public Member Functions
| OFTestTest (const OFString &testName, int flag)
| Constructor.
virtual | ~OFTestTest ()
| Destructor.
int | flags () const
const OFString & | getTestName () const
const TestResult & | runAndReturn ()
| Execute this test case.
virtual void | run ()=0
| Execute this test case.
void | recordFailure (const OFString &file, unsigned long int line, const OFString &message)
| Add a new failure to the result set.
void | recordFailure (const OFString &file, unsigned long int line, const OFString &message, const OFString &errorDetails)
| Add a new failure to the result set.

## Private Attributes
OFString | testName_
| The unique name of this test.
TestResult | results_
| The test results, empty for success.
const int | flags_
| Flags that this test has.

## Detailed Description

A single test case which can be run.

## Member Enumeration Documentation

## ◆ E_Flags

enum OFTestTest::E_Flags

Special flags that a test can have.

The flags for a test are the result of a bitwise or of these individual flags.

Enumerator
EF_Slow | Slow test which should only be run in exhaustive mode.

## Constructor & Destructor Documentation

## ◆ OFTestTest()

OFTestTest::OFTestTest | ( | const OFString & | testName,
|  | int | flag )
| inline

Constructor.

Parameters

  testName | the name of this test case

References flags_, results_, and testName_.

## Member Function Documentation

## ◆ flags()

int OFTestTest::flags | ( |  | ) | const
| inline

Returns
  the flags of this test case

References flags_.

## ◆ getTestName()

const OFString & OFTestTest::getTestName | ( |  | ) | const
| inline

Returns
  the name of this test case

References testName_.

Referenced by OFTestManager::testMatches().

## ◆ recordFailure() [1/2]

void OFTestTest::recordFailure | ( | const OFString & | file,
|  | unsigned long int | line,
|  | const OFString & | message )
| inline

Add a new failure to the result set.

Parameters

  file | filename for this failure
  line | line number for this failure
  message | error description.

References results_, and testName_.

## ◆ recordFailure() [2/2]

void OFTestTest::recordFailure | ( | const OFString & | file,
|  | unsigned long int | line,
|  | const OFString & | message,
|  | const OFString & | errorDetails )
| inline

Add a new failure to the result set.

Parameters

  file | filename for this failure
  line | line number for this failure
  message | error description.
  errorDetails | details of what went wrong

References OFString::empty(), results_, and testName_.

## ◆ run()

virtual void OFTestTest::run | ( |  | ) |
| pure virtual

Execute this test case.

See also
  OFCHECK(condition)

Referenced by runAndReturn().

## ◆ runAndReturn()

const TestResult & OFTestTest::runAndReturn | ( |  | ) |
| inline

Execute this test case.

Returns
  Reference to list of errors.

References results_, and run().

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

- ofstd/include/dcmtk/ofstd/oftest.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1