aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/memblock/tests/common.h
diff options
context:
space:
mode:
authorRebecca Mckeever <remckee0@gmail.com>2022-08-27 00:42:45 -0500
committerMike Rapoport <rppt@linux.ibm.com>2022-08-30 13:12:00 +0300
commitfb2e97fe853ff515df473d4acec6707816e05d87 (patch)
tree17451b344b96040f93b0ec00ec787c8d1d83686c /tools/testing/memblock/tests/common.h
parent25b9defb5bc4aee8beb51ded07838e12745426f9 (diff)
memblock tests: add labels to verbose output for generic alloc tests
Generic tests for memblock_alloc*() functions do not use separate functions for testing top-down and bottom-up allocation directions. Therefore, the function name that is displayed in the verbose testing output does not include the allocation direction. Add an additional prefix when running generic tests for memblock_alloc*() functions that indicates which allocation direction is set. The prefix will be displayed when the tests are run in verbose mode. Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Shaoqin Huang <shaoqin.huang@intel.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Link: https://lore.kernel.org/r/fb76a42253d2a196a7daea29dd8121a69904f58e.1661578349.git.remckee0@gmail.com
Diffstat (limited to 'tools/testing/memblock/tests/common.h')
-rw-r--r--tools/testing/memblock/tests/common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/memblock/tests/common.h b/tools/testing/memblock/tests/common.h
index 93e559780890..c53f9c365714 100644
--- a/tools/testing/memblock/tests/common.h
+++ b/tools/testing/memblock/tests/common.h
@@ -100,4 +100,20 @@ static inline void test_pass_pop(void)
prefix_pop();
}
+static inline void run_top_down(int (*func)())
+{
+ memblock_set_bottom_up(false);
+ prefix_push("top-down");
+ func();
+ prefix_pop();
+}
+
+static inline void run_bottom_up(int (*func)())
+{
+ memblock_set_bottom_up(true);
+ prefix_push("bottom-up");
+ func();
+ prefix_pop();
+}
+
#endif