From 13b56e704c1c6e3428cc6345057e16be02f9ac2f Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 3 Jun 2026 14:42:30 -0700 Subject: [PATCH] doc: add leading * for @code listings --- src/misc/pv/pvUnitTest.h | 82 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/src/misc/pv/pvUnitTest.h b/src/misc/pv/pvUnitTest.h index 1802a98..f6fe69b 100644 --- a/src/misc/pv/pvUnitTest.h +++ b/src/misc/pv/pvUnitTest.h @@ -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, #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(x, "alarm.severity", 1); - @endcode + * @code + * PVStructurePtr x(.....); + * testFieldEqual(x, "alarm.severity", 1); + * @endcode */ template ::detail::testPassx