Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

memblock tests: add tests for memblock_*bottom_up functions

Add simple tests for memblock_set_bottom_up() and memblock_bottom_up().

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/b03701d2faeaf00f7184e4b72903de4e5e939437.1661578349.git.remckee0@gmail.com

authored by

Rebecca Mckeever and committed by
Mike Rapoport
a541c6d4 ae544fd6

+45
+45
tools/testing/memblock/tests/basic_api.c
··· 1679 1679 return 0; 1680 1680 } 1681 1681 1682 + static int memblock_set_bottom_up_check(void) 1683 + { 1684 + prefix_push("memblock_set_bottom_up"); 1685 + 1686 + memblock_set_bottom_up(false); 1687 + ASSERT_EQ(memblock.bottom_up, false); 1688 + memblock_set_bottom_up(true); 1689 + ASSERT_EQ(memblock.bottom_up, true); 1690 + 1691 + reset_memblock_attributes(); 1692 + test_pass_pop(); 1693 + 1694 + return 0; 1695 + } 1696 + 1697 + static int memblock_bottom_up_check(void) 1698 + { 1699 + prefix_push("memblock_bottom_up"); 1700 + 1701 + memblock_set_bottom_up(false); 1702 + ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up); 1703 + ASSERT_EQ(memblock_bottom_up(), false); 1704 + memblock_set_bottom_up(true); 1705 + ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up); 1706 + ASSERT_EQ(memblock_bottom_up(), true); 1707 + 1708 + reset_memblock_attributes(); 1709 + test_pass_pop(); 1710 + 1711 + return 0; 1712 + } 1713 + 1714 + static int memblock_bottom_up_checks(void) 1715 + { 1716 + test_print("Running memblock_*bottom_up tests...\n"); 1717 + 1718 + prefix_reset(); 1719 + memblock_set_bottom_up_check(); 1720 + prefix_reset(); 1721 + memblock_bottom_up_check(); 1722 + 1723 + return 0; 1724 + } 1725 + 1682 1726 int memblock_basic_checks(void) 1683 1727 { 1684 1728 memblock_initialization_check(); ··· 1730 1686 memblock_reserve_checks(); 1731 1687 memblock_remove_checks(); 1732 1688 memblock_free_checks(); 1689 + memblock_bottom_up_checks(); 1733 1690 1734 1691 return 0; 1735 1692 }