AUnit  0.3.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit.
Public Member Functions | List of all members
aunit::TestOnce Class Referenceabstract

Similar to Test but performs the loop() method only once. More...

#include <Test.h>

Inheritance diagram for aunit::TestOnce:
Inheritance graph
[legend]
Collaboration diagram for aunit::TestOnce:
Collaboration graph
[legend]

Public Member Functions

 TestOnce (const char *name)
 Constructor. More...
 
 TestOnce (const __FlashStringHelper *name)
 Constructor. More...
 
virtual void loop () override
 Calls the user-provided once() method. More...
 
virtual void once ()=0
 User-provided test case. More...
 
- Public Member Functions inherited from aunit::Test
 Test (const char *name)
 Constructor taking the name of the given test case. More...
 
 Test (const __FlashStringHelper *name)
 Constructor taking the name of the given test case. More...
 
virtual void setup ()
 Optional method that performs any initialization. More...
 
const FCStringgetName ()
 Get the name of the test. More...
 
uint8_t getStatus ()
 Get the status of the test. More...
 
void setStatus (uint8_t status)
 Set the status of the test. More...
 
void setPassOrFail (bool ok)
 Set the status to Passed or Failed depending on ok. More...
 
Test ** getNext ()
 Return the next pointer as a pointer to the pointer, similar to getRoot(). More...
 
bool isDone ()
 Return true if test is done (passed, failed, skipped, expired). More...
 
bool isNotDone ()
 Return true if test is done (passed, failed, skipped, expired). More...
 
bool isPassed ()
 Return true if test is passed. More...
 
bool isNotPassed ()
 Return true if test is passed. More...
 
bool isFailed ()
 Return true if test is failed. More...
 
bool isNotFailed ()
 Return true if test is failed. More...
 
bool isSkipped ()
 Return true if test isNot skipped. More...
 
bool isNotSkipped ()
 Return true if test isNot skipped. More...
 
bool isExpired ()
 Return true if test is expired. More...
 
bool isNotExpired ()
 Return true if test is expired. More...
 
void skip ()
 Mark the test as skipped. More...
 
void expire ()
 Mark the test as expired (i.e. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from aunit::Test
static Test ** getRoot ()
 Get the pointer to the root pointer. More...
 
- Static Public Attributes inherited from aunit::Test
static const uint8_t kStatusNew = 0
 Test is new, needs to be setup. More...
 
static const uint8_t kStatusSetup = 1
 Test is set up. More...
 
static const uint8_t kStatusPassed = 2
 Test has passed, or pass() was called. More...
 
static const uint8_t kStatusFailed = 3
 Test has failed, or failed() was called. More...
 
static const uint8_t kStatusSkipped = 4
 Test is skipped, through the exclude() method or skip() was called. More...
 
static const uint8_t kStatusExpired = 5
 Test has timed out, or expire() called. More...
 
- Protected Member Functions inherited from aunit::Test
void fail ()
 Mark the test as failed. More...
 
void pass ()
 Mark the test as passed. More...
 

Detailed Description

Similar to Test but performs the loop() method only once.

Definition at line 233 of file Test.h.

Constructor & Destructor Documentation

◆ TestOnce() [1/2]

aunit::TestOnce::TestOnce ( const char *  name)
inlineexplicit

Constructor.

Definition at line 236 of file Test.h.

◆ TestOnce() [2/2]

aunit::TestOnce::TestOnce ( const __FlashStringHelper *  name)
inlineexplicit

Constructor.

Definition at line 240 of file Test.h.

Member Function Documentation

◆ loop()

void aunit::TestOnce::loop ( )
overridevirtual

Calls the user-provided once() method.

If no other assertXxx() macros set the internal status, then this calls pass() to make sure that this test case will be called only once from Test::run().

Implements aunit::Test.

Definition at line 77 of file Test.cpp.

◆ once()

virtual void aunit::TestOnce::once ( )
pure virtual

User-provided test case.


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