scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
Classes | Functions
sctest Namespace Reference

Shimmering Clarity testing library. More...

Classes

class  AssertionFailed
 AssertionFailed indicates that some invariant didn't hold. More...
 
class  NotImplemented
 Exception reserved for unsupported platforms. More...
 
class  Report
 A Report holds test run results. More...
 
class  SimpleSuite
 SimpleSuite is a test-running harness for simple tests. More...
 
struct  UnitTest
 UnitTest describes a single unit test. More...
 

Functions

void Assert (bool condition)
 
void Assert (bool condition, std::string message)
 
std::ostream & operator<< (std::ostream &os, const Report &report)
 
std::ostream & operator<< (std::ostream &os, SimpleSuite &suite)
 

Detailed Description

Shimmering Clarity testing library.

Function Documentation

◆ Assert() [1/2]

void sctest::Assert ( bool  condition)

Assert is a variant on the assert macro. This variant is intended to be a drop-in replacement for the cassert macro: even in release mode, the tests should still run.

If NDEBUG is set, Assert will throw an exception if condition is false. Otherwise, it calls assert after printing the message.

Parameters
conditionIf true, Assert throws an exception.

◆ Assert() [2/2]

void sctest::Assert ( bool  condition,
std::string  message 
)

Assert is a variant on the assert macro.

If NDEBUG is set, Assert will throw an exception if condition is false. Otherwise, it calls assert after printing the message.

In addition to NDEBUG, SCSL_NOEXCEPT will suppress assertions.

Exceptions
AssertionFailed
Parameters
conditionThe condition to assert.
messageThe message that should be displayed if condition is false.

◆ operator<<() [1/2]

std::ostream & sctest::operator<< ( std::ostream &  os,
const Report report 
)

◆ operator<<() [2/2]

std::ostream & sctest::operator<< ( std::ostream &  os,
SimpleSuite suite 
)