arduino-dataflash
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Dummy::SerialNotifier Class Reference

Display test failure informations on the serial line. More...

#include <SerialNotifier.h>

Inheritance diagram for Dummy::SerialNotifier:
Dummy::TestNotificationInterface

Public Types

enum  {
  DefaultValueLen = 32, DefaultFilenameLen = 32, DefaultSuitenameLen = 16, DefaultTestnameLen = 16,
  MaxStringLen = 127
}
 

Public Member Functions

 SerialNotifier (size_t maxValueLen=DefaultValueLen, size_t maxFilenameLen=DefaultFilenameLen, size_t maxSuitenameLen=DefaultSuitenameLen, size_t maxTestnameLen=DefaultTestnameLen)
 Constructor.
 
virtual ~SerialNotifier ()
 Destructor.
 
virtual void NotifyFailure (char const *expected, char const *value, Dummy::Infos const &infos)
 Build failure notification string and send it via Serial.
 
virtual void NotifyResult (const Result &result)
 Tests result notification and send it via Serial.
 
- Public Member Functions inherited from Dummy::TestNotificationInterface
virtual ~TestNotificationInterface ()
 Destructor.
 

Protected Member Functions

void FormatString (char *&out, const char *in, size_t len, size_t allowedLen)
 Add current string to notification string and cut it if necessary.
 

Protected Attributes

size_t m_allowedValueLen
 
size_t m_allowedFilenameLen
 
size_t m_allowedSuitenameLen
 
size_t m_allowedTestnameLen
 
char m_notificationString [128]
 

Detailed Description

Display test failure informations on the serial line.

The notification is : "filename:line suite test expected_value test_value" If filename, suite, test or values are too long they are cut and "..." is appended.

Member Enumeration Documentation

anonymous enum
Enumerator:
DefaultValueLen 
DefaultFilenameLen 
DefaultSuitenameLen 
DefaultTestnameLen 
MaxStringLen 

Constructor & Destructor Documentation

Dummy::SerialNotifier::SerialNotifier ( size_t  maxValueLen = DefaultValueLen,
size_t  maxFilenameLen = DefaultFilenameLen,
size_t  maxSuitenameLen = DefaultSuitenameLen,
size_t  maxTestnameLen = DefaultTestnameLen 
)

Constructor.

Dummy::SerialNotifier::~SerialNotifier ( )
virtual

Destructor.

Member Function Documentation

void Dummy::SerialNotifier::FormatString ( char *&  out,
const char *  in,
size_t  len,
size_t  allowedLen 
)
protected

Add current string to notification string and cut it if necessary.

Parameters
[out]outNotification string pointer.
[in]inInput string.
[in]lenInput string length.
[in]allowedLenAllowed output length.
void Dummy::SerialNotifier::NotifyFailure ( char const *  expected,
char const *  value,
Dummy::Infos const &  infos 
)
virtual

Build failure notification string and send it via Serial.

Parameters
[in]expectedExpected value.
[in]valueObtained value.
[in]infosTest infos.

Implements Dummy::TestNotificationInterface.

void Dummy::SerialNotifier::NotifyResult ( const Result result)
virtual

Tests result notification and send it via Serial.

Parameters
[in]result: tests result.

Implements Dummy::TestNotificationInterface.

Member Data Documentation

size_t Dummy::SerialNotifier::m_allowedFilenameLen
protected
size_t Dummy::SerialNotifier::m_allowedSuitenameLen
protected
size_t Dummy::SerialNotifier::m_allowedTestnameLen
protected
size_t Dummy::SerialNotifier::m_allowedValueLen
protected
char Dummy::SerialNotifier::m_notificationString[128]
protected

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