doc: add leading * for @code listings

This commit is contained in:
Michael Davidsaver committed 2026-06-03 14:42:30 -07:00
1 parent 7a23e8b082
commit 13b56e704c
1 file changed
+40 -42
+40 -42
View File
@@ -69,8 +69,6 @@ inline testPassx testNotEqualx(const char *nLHS, const char *nRHS, const LHS& l,
*
* Helper functions for writing unit tests.
*
@include unittest.cpp
*
* @{
*/
@@ -78,34 +76,34 @@ inline testPassx testNotEqualx(const char *nLHS, const char *nRHS, const LHS& l,
*
* 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.
@code
namespace { // anon
struct MyTest {
MyTest() { } // setup
~MyTest() { } // tear down
void test1() {}
void test2() {}
};
} // namespace anon
MAIN(somename) {
testPlan(0);
TEST_METHOD(MyTest, test1)
TEST_METHOD(MyTest, test2)
return testDone();
}
@endcode
* @code
* namespace { // anon
* struct MyTest {
* MyTest() { } // setup
* ~MyTest() { } // tear down
* void test1() {}
* void test2() {}
* };
* } // namespace anon
* MAIN(somename) {
* testPlan(0);
* TEST_METHOD(MyTest, test1)
* TEST_METHOD(MyTest, test2)
* return testDone();
* }
* @endcode
*/
#define TEST_METHOD(klass, method) ::detail::test_method<klass, &klass::method>(#klass, #method)
/** Compare equality. print left and right hand values and expression strings
*
@code
int x=5;
testEqual(x, 5);
// prints "ok 1 - x (5) == 5 (5)\n"
testEqual(x, 6)<<" oops";
// prints "not ok 1 - x (5) == 6 (6) oops\n"
@endcode
* @code
* int x=5;
* testEqual(x, 5);
* // prints "ok 1 - x (5) == 5 (5)\n"
* testEqual(x, 6)<<" oops";
* // prints "not ok 1 - x (5) == 6 (6) oops\n"
* @endcode
*/
#define testEqual(LHS, RHS) ::detail::testEqualx(#LHS, #RHS, LHS, RHS)
@@ -113,38 +111,38 @@ inline testPassx testNotEqualx(const char *nLHS, const char *nRHS, const LHS& l,
/** Pass/fail from boolean
*
@code
bool y=true;
testTrue(y);
// prints "ok 1 - y\n"
testTrue(!y)<<" oops";
// prints "not ok 1 - !y oops\n"
@endcode
* @code
* bool y=true;
* testTrue(y);
* // prints "ok 1 - y\n"
* testTrue(!y)<<" oops";
* // prints "not ok 1 - !y oops\n"
* @endcode
*/
#define testTrue(B) ::detail::testPassx(!!(B))<<#B
/** Test that a given block throws an exception
*
@code
testThrows(std::runtime_error, somefunc(5))
@endcode
* @code
* testThrows(std::runtime_error, somefunc(5))
* @endcode
*/
#define testThrows(EXC, CODE) try{ CODE; testFail("unexpected success of " #CODE); }catch(EXC& e){testPass("catch expected exception: %s", e.what());}
/** Print test output w/o testing
*
@code
testShow()<<"Foo";
@endcode
* @code
* testShow()<<"Foo";
* @endcode
*/
#define testShow() ::detail::testPassx()
/** Compare value of PVStructure field
*
@code
PVStructurePtr x(.....);
testFieldEqual<epics::pvData::PVInt>(x, "alarm.severity", 1);
@endcode
* @code
* PVStructurePtr x(.....);
* testFieldEqual<epics::pvData::PVInt>(x, "alarm.severity", 1);
* @endcode
*/
template<typename PVD>
::detail::testPassx