In particular, we can assume "somefunc()" exists in our examples.
* file name, line number, and the expression itself.
*
* Example:
* file name, line number, and the expression itself.
*
* Example:
- * ok1(init_subsystem() == 1);
+ * ok1(somefunc() == 1);
*/
# define ok1(e) ((e) ? \
_gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
*/
# define ok1(e) ((e) ? \
_gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
* than simply the expression itself.
*
* Example:
* than simply the expression itself.
*
* Example:
- * ok1(init_subsystem() == 1);
- * ok(init_subsystem() == 0, "Second initialization should fail");
+ * ok1(somefunc() == 1);
+ * ok(somefunc() == 0, "Second somefunc() should fail");
*/
# define ok(e, ...) ((e) ? \
_gen_result(1, __func__, __FILE__, __LINE__, \
*/
# define ok(e, ...) ((e) ? \
_gen_result(1, __func__, __FILE__, __LINE__, \
* branch and fail() in another.
*
* Example:
* branch and fail() in another.
*
* Example:
- * x = do_something();
- * if (!checkable(x) || check_value(x))
- * pass("do_something() returned a valid value");
+ * int x = somefunc();
+ * if (x > 0)
+ * pass("somefunc() returned a valid value");
- * fail("do_something() returned an invalid value");
+ * fail("somefunc() returned an invalid value");
*/
# define pass(...) ok(1, __VA_ARGS__)
*/
# define pass(...) ok(1, __VA_ARGS__)
*
* Example:
* #ifdef HAVE_SOME_FEATURE
*
* Example:
* #ifdef HAVE_SOME_FEATURE
- * ok1(test_some_feature());
* #else
* skip(1, "Don't have SOME_FEATURE");
* #endif
* #else
* skip(1, "Don't have SOME_FEATURE");
* #endif
* put tests in your testing script (always a good idea).
*
* Example:
* put tests in your testing script (always a good idea).
*
* Example:
+ * static bool dwim(void)
+ * {
+ * return false; // NYI
+ * }
+ * ...
* todo_start("dwim() not returning true yet");
* ok(dwim(), "Did what the user wanted");
* todo_end();
* todo_start("dwim() not returning true yet");
* ok(dwim(), "Did what the user wanted");
* todo_end();
* Example:
* plan_no_plan();
* while (random() % 2)
* Example:
* plan_no_plan();
* while (random() % 2)
* exit(exit_status());
*/
void plan_no_plan(void);
* exit(exit_status());
*/
void plan_no_plan(void);
* in the running kernel) use plan_skip_all() instead of plan_tests().
*
* Example:
* in the running kernel) use plan_skip_all() instead of plan_tests().
*
* Example:
- * if (!have_some_feature) {
- * plan_skip_all("Need some_feature support");
- * exit(exit_status());
- * }
+ * #ifndef HAVE_SOME_FEATURE
+ * plan_skip_all("Need SOME_FEATURE support");
+ * exit(exit_status());
+ * #else
*/
void plan_skip_all(const char *reason);
*/
void plan_skip_all(const char *reason);