summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-08-30 22:34:04 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-31 13:56:58 +0000
commit5a1a08381adff5caee99bdfea8fcb7ca30b31734 (patch)
tree9b39201ba753a9bf237457b20002029a6d7dbad9
parentced5a544324099241762d652c086f00c63f3d679 (diff)
downloadchrome-ec-5a1a08381adff5caee99bdfea8fcb7ca30b31734.tar.gz
test: update default setup/teardown functions
When using ztest_unit_test the default setup/teardown functions should be before_test() and after_test(). BRANCH=none BUG=none TEST=make buildall -j Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ia1a65923a39d3f193a9cedecdc9d716dcf136eb6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3132306 Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--include/test_util.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/include/test_util.h b/include/test_util.h
index a4daaf7f87..62bd468924 100644
--- a/include/test_util.h
+++ b/include/test_util.h
@@ -399,17 +399,6 @@ struct unit_test {
};
/**
- * @brief void(*)(void) function that does nothing.
- *
- * This function should be used for setup or teardown when no work is required.
- * Note that before_test() and after_test() will still be run to maintain
- * compatibility.
- */
-static inline void unit_test_noop(void)
-{
-}
-
-/**
* Create a unit test for a given function name with provided setup/teardown
* functions.
*
@@ -433,7 +422,7 @@ static inline void unit_test_noop(void)
* @see ztest_unit_test_setup_teardown
*/
#define ztest_unit_test(fn) \
- ztest_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop)
+ ztest_unit_test_setup_teardown(fn, before_test, after_test)
/**
* @brief Create a test suite