PVData C++
8.0.6
|
Macros | |
#define | TEST_METHOD(klass, method) ::detail::test_method<klass, &klass::method>(#klass, #method) |
#define | testEqual(LHS, RHS) ::detail::testEqualx(#LHS, #RHS, LHS, RHS) |
#define | testNotEqual(LHS, RHS) ::detail::testNotEqualx(#LHS, #RHS, LHS, RHS) |
#define | testTrue(B) ::detail::testPassx(!!(B))<<#B |
#define | testThrows(EXC, CODE) try{ CODE; testFail("unexpected success of " #CODE); }catch(EXC& e){testPass("catch expected exception: %s", e.what());} |
#define | testShow() ::detail::testPassx() |
Functions | |
template<typename PVD > | |
::detail::testPassx | testFieldEqual (const std::tr1::shared_ptr< const epics::pvData::PVStructure > &val, const char *name, typename PVD::value_type expect) |
template<typename PVD > | |
::detail::testPassx | testFieldEqual (const std::tr1::shared_ptr< const epics::pvData::PVStructure > &val, const char *name, typename PVD::const_svector expect) |
Helper functions for writing unit tests.
#define TEST_METHOD | ( | klass, | |
method | |||
) | ::detail::test_method<klass, &klass::method>(#klass, #method) |
Run a class method as a test.
Each invocation of TEST_METHOD() constructs a new instance of 'klass' on the stack. Thus constructor and destructor can be used for common test setup and tear down.
Definition at line 98 of file pvUnitTest.h.
#define testEqual | ( | LHS, | |
RHS | |||
) | ::detail::testEqualx(#LHS, #RHS, LHS, RHS) |
Compare equality. print left and right hand values and expression strings
Definition at line 110 of file pvUnitTest.h.
#define testShow | ( | ) | ::detail::testPassx() |
#define testThrows | ( | EXC, | |
CODE | |||
) | try{ CODE; testFail("unexpected success of " #CODE); }catch(EXC& e){testPass("catch expected exception: %s", e.what());} |
Test that a given block throws an exception
Definition at line 132 of file pvUnitTest.h.
#define testTrue | ( | B | ) | ::detail::testPassx(!!(B))<<#B |
Pass/fail from boolean
Definition at line 124 of file pvUnitTest.h.
::detail::testPassx testFieldEqual | ( | const std::tr1::shared_ptr< const epics::pvData::PVStructure > & | val, |
const char * | name, | ||
typename PVD::value_type | expect | ||
) |
Compare value of PVStructure field
Definition at line 151 of file pvUnitTest.h.