]> git.ipfire.org Git - thirdparty/u-boot.git/blame - test/lib/uuid.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[thirdparty/u-boot.git] / test / lib / uuid.c
CommitLineData
b83dc8df
AEK
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Functional tests for UCLASS_FFA class
4 *
5 * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
6 *
7 * Authors:
8 * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
9 */
10
d678a59d 11#include <common.h>
b83dc8df
AEK
12#include <uuid.h>
13#include <test/lib.h>
14#include <test/test.h>
15#include <test/ut.h>
16
17/* test UUID */
18#define TEST_SVC_UUID "ed32d533-4209-99e6-2d72-cdd998a79cc0"
19
20#define UUID_SIZE 16
21
22/* The UUID binary data (little-endian format) */
23static const u8 ref_uuid_bin[UUID_SIZE] = {
24 0x33, 0xd5, 0x32, 0xed,
25 0x09, 0x42, 0xe6, 0x99,
26 0x72, 0x2d, 0xc0, 0x9c,
27 0xa7, 0x98, 0xd9, 0xcd
28};
29
30static int lib_test_uuid_to_le(struct unit_test_state *uts)
31{
32 const char *uuid_str = TEST_SVC_UUID;
33 u8 ret_uuid_bin[UUID_SIZE] = {0};
34
35 ut_assertok(uuid_str_to_le_bin(uuid_str, ret_uuid_bin));
36 ut_asserteq_mem(ref_uuid_bin, ret_uuid_bin, UUID_SIZE);
37
38 return 0;
39}
40
41LIB_TEST(lib_test_uuid_to_le, 0);