FreeNOS
Public Types | Public Member Functions | Private Attributes
TestResult Class Reference

Represents a Test result created by a TestInstance. More...

#include <TestResult.h>

Public Types

enum  Result { Success, Failure, Skipped }
 Result codes. More...
 

Public Member Functions

 TestResult (Result result, const char *description="")
 Constructor. More...
 
bool isOK () const
 Check if the test passed. More...
 
bool isFailed () const
 Check if the test failed. More...
 
bool isSkipped () const
 Check if the test is skipped. More...
 
const Result getResult () const
 Get result code. More...
 
StringgetDescription ()
 Get result description. More...
 

Private Attributes

const Result m_result
 The result code for this test. More...
 
String m_description
 Text describing the result. More...
 

Detailed Description

Represents a Test result created by a TestInstance.

Definition at line 47 of file TestResult.h.

Member Enumeration Documentation

◆ Result

Result codes.

Enumerator
Success 
Failure 
Skipped 

Definition at line 54 of file TestResult.h.

Constructor & Destructor Documentation

◆ TestResult()

TestResult::TestResult ( Result  result,
const char *  description = "" 
)

Constructor.

Definition at line 20 of file TestResult.cpp.

Member Function Documentation

◆ getDescription()

String & TestResult::getDescription ( )

Get result description.

Definition at line 45 of file TestResult.cpp.

References m_description.

Referenced by StdoutReporter::reportAfter(), TAPReporter::reportAfter(), and XMLReporter::reportAfter().

◆ getResult()

const TestResult::Result TestResult::getResult ( ) const

Get result code.

Definition at line 40 of file TestResult.cpp.

References m_result.

Referenced by StdoutReporter::reportAfter(), TAPReporter::reportAfter(), and XMLReporter::reportAfter().

◆ isFailed()

bool TestResult::isFailed ( ) const

Check if the test failed.

Definition at line 30 of file TestResult.cpp.

References Failure, and m_result.

Referenced by TestReporter::collect().

◆ isOK()

bool TestResult::isOK ( ) const

Check if the test passed.

Definition at line 25 of file TestResult.cpp.

References m_result, and Success.

Referenced by TestReporter::collect().

◆ isSkipped()

bool TestResult::isSkipped ( ) const

Check if the test is skipped.

Definition at line 35 of file TestResult.cpp.

References m_result, and Skipped.

Referenced by TestReporter::collect().

Field Documentation

◆ m_description

String TestResult::m_description
private

Text describing the result.

Definition at line 99 of file TestResult.h.

Referenced by getDescription().

◆ m_result

const Result TestResult::m_result
private

The result code for this test.

Definition at line 96 of file TestResult.h.

Referenced by getResult(), isFailed(), isOK(), and isSkipped().


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