1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /*
3  * libfdt - Flat Device Tree manipulation
4  *	Testcase for character literals in dtc
5  * Copyright (C) 2006 David Gibson, IBM Corporation.
6  * Copyright (C) 2011 The Chromium Authors. All rights reserved.
7  */
8 #include <stdlib.h>
9 #include <stdio.h>
10 #include <string.h>
11 #include <stdint.h>
12 
13 #include <libfdt.h>
14 
15 #include "tests.h"
16 #include "testdata.h"
17 
main(int argc,char * argv[])18 int main(int argc, char *argv[])
19 {
20 	void *fdt;
21 	fdt32_t expected_cells[5];
22 
23 	expected_cells[0] = cpu_to_fdt32((unsigned char)TEST_CHAR1);
24 	expected_cells[1] = cpu_to_fdt32((unsigned char)TEST_CHAR2);
25 	expected_cells[2] = cpu_to_fdt32((unsigned char)TEST_CHAR3);
26 	expected_cells[3] = cpu_to_fdt32((unsigned char)TEST_CHAR4);
27 	expected_cells[4] = cpu_to_fdt32((unsigned char)TEST_CHAR5);
28 
29 	test_init(argc, argv);
30 	fdt = load_blob_arg(argc, argv);
31 
32 	check_getprop(fdt, 0, "char-literal-cells",
33 		      sizeof(expected_cells), expected_cells);
34 
35 	PASS();
36 }
37