ManaPlus
Namespaces | Data Structures | Typedefs | Functions
Catch Namespace Reference

Namespaces

 Detail
 
 Generators
 
 Internal
 
 Matchers
 

Data Structures

struct  CaseSensitive
 
class  NonCopyable
 
class  SafeBool
 
struct  pluralise
 
struct  SourceLineInfo
 
struct  StreamEndStop
 
class  NotImplementedException
 
struct  IGeneratorInfo
 
struct  IGeneratorsForTest
 
class  Ptr
 
struct  IShared
 
struct  SharedImpl
 
struct  IContext
 
struct  IMutableContext
 
struct  ITestCase
 
struct  ITestCaseRegistry
 
class  MethodTestCase
 
struct  NameAndDesc
 
struct  AutoReg
 
struct  ResultWas
 
struct  ResultDisposition
 
struct  AssertionInfo
 
struct  AssertionResultData
 
class  AssertionResult
 
struct  TestFailureException
 
class  ExpressionLhs
 
struct  CopyableStream
 
class  ResultBuilder
 
struct  StringMaker
 
struct  StringMaker< T * >
 
struct  StringMaker< R C::* >
 
struct  MessageInfo
 
struct  MessageBuilder
 
class  ScopedMessage
 
struct  IResultCapture
 
struct  IRunner
 
struct  Counts
 
struct  Totals
 
struct  SectionInfo
 
struct  SectionEndInfo
 
class  Timer
 
class  Section
 
struct  IGenerator
 
class  BetweenGenerator
 
class  ValuesGenerator
 
class  CompositeGenerator
 
struct  IRegistryHub
 
struct  IMutableRegistryHub
 
struct  IExceptionTranslator
 
struct  IExceptionTranslatorRegistry
 
class  ExceptionTranslatorRegistrar
 
struct  TagAlias
 
struct  RegistrarForTagAliases
 
class  Option
 
struct  ITagAliasRegistry
 
struct  TestCaseInfo
 
class  TestCase
 

Typedefs

typedef void(* TestFunction) ()
 
typedef std::string(* exceptionTranslateFunction) ()
 
typedef std::vector< const IExceptionTranslator * > ExceptionTranslators
 

Functions

template<typename ContainerT >
void deleteAll (ContainerT &container)
 
template<typename AssociativeContainerT >
void deleteAllValues (AssociativeContainerT &container)
 
bool startsWith (std::string const &s, std::string const &prefix)
 
bool endsWith (std::string const &s, std::string const &suffix)
 
bool contains (std::string const &s, std::string const &infix)
 
void toLowerInPlace (std::string &s)
 
std::string toLower (std::string const &s)
 
std::string trim (std::string const &str)
 
bool replaceInPlace (std::string &str, std::string const &replaceThis, std::string const &withThis)
 
std::ostream & operator<< (std::ostream &os, SourceLineInfo const &info)
 
bool isTrue (bool value)
 
bool alwaysTrue ()
 
bool alwaysFalse ()
 
void throwLogicError (std::string const &message, SourceLineInfo const &locationInfo)
 
void seedRng (IConfig const &config)
 
unsigned int rngSeed ()
 
template<typename T >
T const & operator+ (T const &value, StreamEndStop)
 
IGeneratorsForTestcreateGeneratorsForTest ()
 
IContextgetCurrentContext ()
 
IMutableContextgetCurrentMutableContext ()
 
void cleanUpContext ()
 
Stream createStream (std::string const &streamName)
 
bool matchTest (TestCase const &testCase, TestSpec const &testSpec, IConfig const &config)
 
std::vector< TestCasefilterTests (std::vector< TestCase > const &testCases, TestSpec const &testSpec, IConfig const &config)
 
std::vector< TestCase > const & getAllTestCasesSorted (IConfig const &config)
 
void registerTestCase (ITestCase *testCase, char const *className, NameAndDesc const &nameAndDesc, SourceLineInfo const &lineInfo)
 
void registerTestCaseFunction (TestFunction function, SourceLineInfo const &lineInfo, NameAndDesc const &nameAndDesc)
 
bool isOk (ResultWas::OfType resultType)
 
bool isJustInfo (int flags)
 
ResultDisposition::Flags operator| (ResultDisposition::Flags lhs, ResultDisposition::Flags rhs)
 
bool shouldContinueOnFailure (int flags)
 
bool isFalseTest (int flags)
 
bool shouldSuppressFailure (int flags)
 
template<typename T >
std::string toString (T const &value)
 converts any type to a string More...
 
std::string toString (std::string const &value)
 
std::string toString (std::wstring const &value)
 
std::string toString (const char *const value)
 
std::string toString (char *const value)
 
std::string toString (const wchar_t *const value)
 
std::string toString (wchar_t *const value)
 
std::string toString (int value)
 
std::string toString (unsigned long value)
 
std::string toString (unsigned int value)
 
std::string toString (const double value)
 
std::string toString (const float value)
 
std::string toString (bool value)
 
std::string toString (char value)
 
std::string toString (signed char value)
 
std::string toString (unsigned char value)
 
template<typename T , typename Allocator >
std::string toString (std::vector< T, Allocator > const &v)
 
IResultCapturegetResultCapture ()
 
bool isDebuggerActive ()
 
void writeToDebugConsole (std::string const &text)
 
IRegistryHubgetRegistryHub ()
 
IMutableRegistryHubgetMutableRegistryHub ()
 
void cleanUp ()
 
std::string translateActiveException ()
 
template<>
std::string toString< Detail::Approx > (Detail::Approx const &value)
 
TestCase makeTestCase (ITestCase *testCase, std::string const &className, std::string const &name, std::string const &description, SourceLineInfo const &lineInfo)
 

Typedef Documentation

◆ exceptionTranslateFunction

typedef std::string(* Catch::exceptionTranslateFunction) ()

Definition at line 2560 of file catch.hpp.

◆ ExceptionTranslators

Definition at line 2563 of file catch.hpp.

◆ TestFunction

typedef void(* Catch::TestFunction) ()

Definition at line 657 of file catch.hpp.

Function Documentation

◆ alwaysFalse()

bool Catch::alwaysFalse ( )
inline

Definition at line 407 of file catch.hpp.

407 { return false; }

◆ alwaysTrue()

bool Catch::alwaysTrue ( )
inline

Definition at line 406 of file catch.hpp.

406 { return true; }

◆ cleanUp()

void Catch::cleanUp ( )

◆ cleanUpContext()

void Catch::cleanUpContext ( )

◆ contains()

bool Catch::contains ( std::string const &  s,
std::string const &  infix 
)

◆ createGeneratorsForTest()

IGeneratorsForTest* Catch::createGeneratorsForTest ( )

◆ createStream()

Stream Catch::createStream ( std::string const &  streamName)

◆ deleteAll()

template<typename ContainerT >
void Catch::deleteAll ( ContainerT &  container)
inline

Definition at line 353 of file catch.hpp.

353  {
354  typename ContainerT::const_iterator it = container.begin();
355  typename ContainerT::const_iterator itEnd = container.end();
356  for(; it != itEnd; ++it )
357  delete *it;
358  }

Referenced by Catch::CompositeGenerator< T >::~CompositeGenerator().

◆ deleteAllValues()

template<typename AssociativeContainerT >
void Catch::deleteAllValues ( AssociativeContainerT &  container)
inline

Definition at line 360 of file catch.hpp.

360  {
361  typename AssociativeContainerT::const_iterator it = container.begin();
362  typename AssociativeContainerT::const_iterator itEnd = container.end();
363  for(; it != itEnd; ++it )
364  delete it->second;
365  }

◆ endsWith()

bool Catch::endsWith ( std::string const &  s,
std::string const &  suffix 
)

◆ filterTests()

std::vector<TestCase> Catch::filterTests ( std::vector< TestCase > const &  testCases,
TestSpec const &  testSpec,
IConfig const &  config 
)

◆ getAllTestCasesSorted()

std::vector<TestCase> const& Catch::getAllTestCasesSorted ( IConfig const &  config)

◆ getCurrentContext()

IContext& Catch::getCurrentContext ( )

◆ getCurrentMutableContext()

IMutableContext& Catch::getCurrentMutableContext ( )

◆ getMutableRegistryHub()

IMutableRegistryHub& Catch::getMutableRegistryHub ( )

◆ getRegistryHub()

IRegistryHub& Catch::getRegistryHub ( )

◆ getResultCapture()

IResultCapture& Catch::getResultCapture ( )

◆ isDebuggerActive()

bool Catch::isDebuggerActive ( )

◆ isFalseTest()

bool Catch::isFalseTest ( int  flags)
inline

Definition at line 821 of file catch.hpp.

821 { return ( flags & ResultDisposition::FalseTest ) != 0; }

References Catch::ResultDisposition::FalseTest.

◆ isJustInfo()

bool Catch::isJustInfo ( int  flags)
inline

Definition at line 803 of file catch.hpp.

803  {
804  return flags == ResultWas::Info;
805  }

References Catch::ResultWas::Info.

◆ isOk()

bool Catch::isOk ( ResultWas::OfType  resultType)
inline

Definition at line 800 of file catch.hpp.

800  {
801  return ( resultType & ResultWas::FailureBit ) == 0;
802  }

References Catch::ResultWas::FailureBit.

◆ isTrue()

bool Catch::isTrue ( bool  value)
inline

Definition at line 405 of file catch.hpp.

405 { return value; }

◆ makeTestCase()

TestCase Catch::makeTestCase ( ITestCase testCase,
std::string const &  className,
std::string const &  name,
std::string const &  description,
SourceLineInfo const &  lineInfo 
)

◆ matchTest()

bool Catch::matchTest ( TestCase const &  testCase,
TestSpec const &  testSpec,
IConfig const &  config 
)

◆ operator+()

template<typename T >
T const& Catch::operator+ ( T const &  value,
StreamEndStop   
)

Definition at line 424 of file catch.hpp.

424  {
425  return value;
426  }

◆ operator<<()

std::ostream& Catch::operator<< ( std::ostream &  os,
SourceLineInfo const &  info 
)

◆ operator|()

Definition at line 816 of file catch.hpp.

816  {
817  return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
818  }

◆ registerTestCase()

void Catch::registerTestCase ( ITestCase testCase,
char const *  className,
NameAndDesc const &  nameAndDesc,
SourceLineInfo const &  lineInfo 
)

Referenced by Catch::AutoReg::AutoReg().

◆ registerTestCaseFunction()

void Catch::registerTestCaseFunction ( TestFunction  function,
SourceLineInfo const &  lineInfo,
NameAndDesc const &  nameAndDesc 
)

◆ replaceInPlace()

bool Catch::replaceInPlace ( std::string &  str,
std::string const &  replaceThis,
std::string const &  withThis 
)

◆ rngSeed()

unsigned int Catch::rngSeed ( )

◆ seedRng()

void Catch::seedRng ( IConfig const &  config)

◆ shouldContinueOnFailure()

bool Catch::shouldContinueOnFailure ( int  flags)
inline

Definition at line 820 of file catch.hpp.

820 { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }

References Catch::ResultDisposition::ContinueOnFailure.

◆ shouldSuppressFailure()

bool Catch::shouldSuppressFailure ( int  flags)
inline

Definition at line 822 of file catch.hpp.

822 { return ( flags & ResultDisposition::SuppressFail ) != 0; }

References Catch::ResultDisposition::SuppressFail.

◆ startsWith()

bool Catch::startsWith ( std::string const &  s,
std::string const &  prefix 
)

◆ throwLogicError()

void Catch::throwLogicError ( std::string const &  message,
SourceLineInfo const &  locationInfo 
)

◆ toLower()

std::string Catch::toLower ( std::string const &  s)

◆ toLowerInPlace()

void Catch::toLowerInPlace ( std::string &  s)

◆ toString() [1/17]

std::string Catch::toString ( bool  value)

◆ toString() [2/17]

std::string Catch::toString ( char *const  value)

◆ toString() [3/17]

std::string Catch::toString ( char  value)

◆ toString() [4/17]

std::string Catch::toString ( const char *const  value)

◆ toString() [5/17]

std::string Catch::toString ( const double  value)

◆ toString() [6/17]

std::string Catch::toString ( const float  value)

◆ toString() [7/17]

std::string Catch::toString ( const wchar_t *const  value)

◆ toString() [8/17]

std::string Catch::toString ( int  value)

◆ toString() [9/17]

std::string Catch::toString ( signed char  value)

◆ toString() [10/17]

std::string Catch::toString ( std::string const &  value)

◆ toString() [11/17]

template<typename T , typename Allocator >
std::string Catch::toString ( std::vector< T, Allocator > const &  v)

Definition at line 1713 of file catch.hpp.

1713  {
1714  return Detail::rangeToString( v.begin(), v.end() );
1715 }
std::string rangeToString(InputIterator first, InputIterator last)
Definition: catch.hpp:1780

References Catch::Detail::rangeToString().

◆ toString() [12/17]

std::string Catch::toString ( std::wstring const &  value)

◆ toString() [13/17]

template<typename T >
std::string Catch::toString ( T const &  value)

converts any type to a string

The default template forwards on to ostringstream - except when an ostringstream overload does not exist - in which case it attempts to detect that and writes {?}. Overload (not specialise) this template for custom typs that you don't want to provide an ostream overload for.

Definition at line 1774 of file catch.hpp.

1774  {
1775  return StringMaker<T>::convert( value );
1776 }

References Catch::Detail::StringMakerBase< Detail::IsStreamInsertable< T >::value >::convert().

Referenced by Pincode::action(), Setup_Colors::action(), Setup_Video::action(), CharSelectDialog::action(), KillStats::action(), Pincode::addButtons(), ChatWindow::addColors(), LocalPlayer::addJobMessage(), SkillDialog::addSkill(), LocalPlayer::addXpMessage(), ChatWindow::attributeChanged(), KillStats::attributeChanged(), ConfigManager::backupConfig(), Setup_Video::cancel(), Catch::ExpressionLhs< T >::captureExpression(), createGuiWindows(), debugCallback(), ResourceManager::deleteInstance(), ResourceManager::deleteResourceManager(), UpdaterWindow::download(), ItemContainer::draw(), ItemShortcutContainer::draw(), VirtShortcutContainer::draw(), EquipmentWindow::draw(), FloorItem::draw(), Viewport::drawPath(), EditServerDialog::EditServerDialog(), Catch::ExpressionLhs< T >::endExpression(), TestMain::exec(), Joystick::finishCalibration(), SetupItemDropDown::fromWidget(), SetupItemSlider::fromWidget(), SetupItemSlider2::fromWidget(), SetupItemSliderInt::fromWidget(), SetupActionDropDown::fromWidget(), KillStats::gainXp(), SDL::getAllVideoModes(), ItemPopup::getCardsString(), WorldListModel::getElementAt(), ScrollArea::getImageByState(), Loader::getImageSet(), ItemPopup::getOptionsString(), LocalPlayer::getPingTime(), Theme::getProgressColor(), Loader::getSprite(), Configuration::getStringValue(), Loader::getSubImage(), Loader::getSubImageSet(), PopupMenu::handleLink(), Map::initializeAmbientLayers(), KillStats::KillStats(), ItemShortcut::load(), ShortcutBase::load(), SetupItem::load(), OutfitWindow::load(), SpellManager::load(), MiniStatusWindow::loadBars(), WindowMenu::loadButtons(), ServerDialog::loadCustomServers(), loadQuest(), ChatWindow::loadState(), UpdaterWindow::logic(), ResourceManager::logResource(), ModeListModel::ModeListModel(), MiniStatusWindow::mouseMoved(), Joystick::open(), SpellManager::parseCommand(), EAthena::MessageIn::postInit(), TmwAthena::ChatRecv::processBeingChat(), TmwAthena::TradeRecv::processTradeItemAddResponse(), Catch::Detail::rangeToString(), Net::MessageIn::readCoordinatePair(), Net::MessageIn::readCoordinates(), MapReader::readTileset(), Configuration::removeOldKeys(), TmwAthena::BuySellHandler::requestBuyList(), GuildManager::requestGuildInfo(), TmwAthena::BuySellHandler::requestSellList(), ItemContainer::safeDraw(), ItemShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), EquipmentWindow::safeDraw(), EmoteShortcut::save(), ItemShortcut::save(), ShortcutBase::save(), OutfitWindow::save(), SpellManager::save(), MiniStatusWindow::saveBars(), WindowMenu::saveButtons(), ServerDialog::saveCustomServers(), PlayerInfo::saveProtectedItems(), ChatWindow::saveState(), ChatWindow::saveTab(), Being::setAction(), CharCreateDialog::setAttributes(), Setup_Colors::setEntry(), Setup_Video::Setup_Video(), Setup_Visual::Setup_Visual(), IntTextField::setValue(), Configuration::setValue(), Configuration::setValueInt(), Being::showName(), QuestsWindow::showQuest(), Pincode::shuffle(), Net::MessageIn::skip(), Net::MessageIn::skipToEnd(), GuildManager::slowLogic(), InputManager::store(), Being::takeDamage(), Catch::Detail::Approx::toString(), AttrDisplay::update(), ChangeDisplay::update(), KillStats::update(), SkillInfo::update(), StatusWindow::updateArrowsBar(), ShopItem::updateDisplayName(), StatusWindow::updateHPBar(), StatusWindow::updateMPBar(), ActorManager::updateNameId(), UpdaterWindow::updateProgress(), StatusWindow::updateProgressBar(), CharCreateDialog::updateSliders(), WhoIsOnline::updateWindow(), anonymous_namespace{playerrelations.cpp}::PlayerConfSerialiser::writeConfigItem(), and PacketLimiter::writePacketLimits().

◆ toString() [14/17]

std::string Catch::toString ( unsigned char  value)

◆ toString() [15/17]

std::string Catch::toString ( unsigned int  value)

◆ toString() [16/17]

std::string Catch::toString ( unsigned long  value)

◆ toString() [17/17]

std::string Catch::toString ( wchar_t *const  value)

◆ toString< Detail::Approx >()

template<>
std::string Catch::toString< Detail::Approx > ( Detail::Approx const &  value)
inline

Definition at line 2693 of file catch.hpp.

2693  {
2694  return value.toString();
2695 }

References Catch::Detail::Approx::toString().

◆ translateActiveException()

std::string Catch::translateActiveException ( )

◆ trim()

std::string Catch::trim ( std::string const &  str)

◆ writeToDebugConsole()

void Catch::writeToDebugConsole ( std::string const &  text)