mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-30 19:48:19 +00:00 
			
		
		
		
	Test ofnode_device_is_compatible(), and also ofnode_path(). Requested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
		
			
				
	
	
		
			18 lines
		
	
	
		
			415 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			415 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| 
 | |
| #include <common.h>
 | |
| #include <dm.h>
 | |
| #include <dm/test.h>
 | |
| #include <test/ut.h>
 | |
| 
 | |
| static int dm_test_ofnode_compatible(struct unit_test_state *uts)
 | |
| {
 | |
| 	ofnode root_node = ofnode_path("/");
 | |
| 
 | |
| 	ut_assert(ofnode_valid(root_node));
 | |
| 	ut_assert(ofnode_device_is_compatible(root_node, "sandbox"));
 | |
| 
 | |
| 	return 0;
 | |
| }
 | |
| DM_TEST(dm_test_ofnode_compatible, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 |