Skip to content

Commit b823bc1

Browse files
committed
Updating comments
Signed-off-by: Stephen Brawner <brawner@gmail.com>
1 parent b03d89e commit b823bc1

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

include/rcutils/testing/fault_injection.h

+13-9
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ bool
3636
rcutils_fault_injection_is_test_complete(void);
3737

3838
/**
39-
* \def RCUTILS_FAULT_INJECTION_SET_COUNT
4039
* \brief Atomically set the fault injection counter.
4140
*
42-
* There will be at most one fault injected failure per call to RCUTILS_FAULT_INJECTION_SET_COUNT.
41+
* There will be at most one fault injected failure per call to `rcutils_fault_injection_set_count`.
4342
* To test all reachable fault injection locations, call this macro inside a loop and set the count
4443
* to an incrementing count variable.
4544
*
4645
* for (int i = 0; i < SUFFICIENTLY_LARGE_ITERATION_COUNT; ++i) {
47-
* RCUTILS_FAULT_INJECTION_SET_COUNT(i);
46+
* rcutils_fault_injection_set_count(i);
4847
* ... // Call function under test
4948
* }
5049
* ASSERT_LT(RCUTILS_FAULT_INJECTION_NEVER_FAIL, RCUTILS_FAULT_INJECTION_GET_COUNT());
@@ -69,20 +68,25 @@ void
6968
rcutils_fault_injection_set_count(int count);
7069

7170
/**
72-
* \def RCUTILS_FAULT_INJECTION_GET_COUNT
7371
* \brief Atomically get the fault injection counter value
7472
*
75-
* Use this macro after running the code under test to check whether the counter reached a negative
76-
* value. This is helpful so you can verify that you ran the fault injection test in a loop a
77-
* sufficient number of times. Likewise, if the code under test returned with an error, but the
78-
* count value was greater or equal to 0, then the failure was not caused by the fault injection
79-
* counter.
73+
* Use this function after running the code under test to check whether the counter reached a
74+
* negative value. This is helpful so you can verify that you ran the fault injection test in a
75+
* loop a sufficient number of times. Likewise, if the code under test returned with an error, but
76+
* the count value was greater or equal to 0, then the failure was not caused by the fault
77+
* injection counter.
8078
*/
8179
RCUTILS_PUBLIC
8280
RCUTILS_WARN_UNUSED
8381
int_least64_t
8482
rcutils_fault_injection_get_count(void);
8583

84+
/**
85+
* \brief Implementation of fault injection decrementer
86+
*
87+
* This is included inside of macros, so it needs to be exported as a public function, but it
88+
* should not be used directly.
89+
*/
8690
RCUTILS_PUBLIC
8791
RCUTILS_WARN_UNUSED
8892
int_least64_t

0 commit comments

Comments
 (0)