blob: 3a69e28a62a17ac2b385228771ed44b12c82694c [file] [log] [blame]
Rob Herringc4ffc052019-06-20 15:19:41 -06001// SPDX-License-Identifier: LGPL-2.1-or-later
Anton Staafa4ea2fa2011-09-09 12:16:30 -07002/*
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.
Anton Staafa4ea2fa2011-09-09 12:16:30 -07007 */
8#include <stdlib.h>
9#include <stdio.h>
10#include <string.h>
11#include <stdint.h>
12
Anton Staafa4ea2fa2011-09-09 12:16:30 -070013#include <libfdt.h>
14
15#include "tests.h"
16#include "testdata.h"
17
18int main(int argc, char *argv[])
19{
20 void *fdt;
David Gibsonbad5b282017-03-06 12:08:53 +110021 fdt32_t expected_cells[5];
Anton Staafa4ea2fa2011-09-09 12:16:30 -070022
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}